Skip to content

Commit

Permalink
Add options for maxRetries and httpTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans Kristian Flaatten committed Sep 2, 2014
1 parent 3188751 commit f59dca4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ var Upload = require('s3-uploader');
* string `awsBucketUrl` - publicly accessible url to your bucket
* string `awsBucketPath` - path within your bucket (ex. "/images")
* string `awsBucketAcl` - default ACL for uploded images
* number `awsMaxRetries` - max number of retries; default 3
* number `awsHttpTimeout` - inactive time (ms) beofre timing out; default 1000
* number `resizeQuality` - default resize quallity
* boolean `returnExif` - return exif data for original image
* string `tmpDir` - directory to store temporary files
Expand Down
6 changes: 5 additions & 1 deletion src/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ rand = require('crypto').pseudoRandomBytes
Upload = module.exports = (awsBucketName, opts) ->
throw new Error 'Bucket name can not be undefined' if not awsBucketName

@s3 = new S3 params: Bucket: awsBucketName
@s3 = new S3
maxRetries: opts?.awsMaxRetries or 3
sslEnabled: true
httpOptions: timeout: opts?.awsHttpTimeout or 1000
params: Bucket: awsBucketName

@versions = opts?.versions or []

Expand Down

0 comments on commit f59dca4

Please sign in to comment.