fix: settings can be from opts or from process.env

This commit is contained in:
sirpy 2019-05-06 23:46:35 +03:00 committed by GitHub
parent 1c44bf900e
commit ed9b234c21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ var u, AWS;
Gun.on('create', function(root){
this.to.next(root);
var opt = root.opt;
if(!process.env.AWS_S3_BUCKET){ return }
if(!opt.s3 && !process.env.AWS_S3_BUCKET){ return }
opt.batch = opt.batch || (1000 * 10);
opt.until = opt.until || (1000 * 3);
opt.chunk = opt.chunk || (1024 * 1024 * 10); // 10MB
@ -101,4 +101,4 @@ function Store(opt){
return store;
}
module.exports = Store;
module.exports = Store;