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