4
votes

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);

            });
1

1 Answers

1
votes

As of this date (July 28th, 2016), there's no way of customizing these two options. There's a feature request on Github AWS SDK for JS repository for that.