I am using aws S3 nodejs sdk and I need to check if a file exist in my bucket as quickly as possible.
The default params of the AWS.S3.waitFor() method check to object existence every 5 seconds with 20 attempts max. I would need to check it every 2 seconds if possible. I can change the configuration file (s3-2006-03-01.waiters.json) to achieve that but I'm looking for a programmatic way to do it. Is there any way to achieve that ? My code looks like this for the moment:
s3.waitFor('objectExists',{
Bucket : 'XXXXX',
Key : _Key,
},function (err){
if(err){
return _callback(err);
}
return _callback(false);
});