Skip to content

Commit f71d845

Browse files
committed
Added ability to specify options in the toS3 stream function
Default leoS3 to use STANDARD_IA
1 parent b493bc5 commit f71d845

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/stream/helper/leos3.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ module.exports = function(ls, queue, configure, opts, onFlush) {
1616
seconds: 10
1717
},
1818
archive: false,
19-
sectionCount: 10
19+
sectionCount: 10,
20+
s3PutOpts: {
21+
StorageClass: "STANDARD_IA"
22+
}
2023
}, opts || {});
2124
let fileCount = 0;
2225

@@ -70,7 +73,7 @@ module.exports = function(ls, queue, configure, opts, onFlush) {
7073
}
7174

7275
logger.info("S3 Location:", newFile);
73-
s3 = ls.toS3(configure.resources.LeoS3 || configure.s3, newFile);
76+
s3 = ls.toS3(configure.resources.LeoS3 || configure.s3, newFile, opts.s3PutOpts);
7477
e = {
7578
event: queue,
7679
start: null,

lib/stream/leo-stream.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,11 @@ module.exports = function(configure) {
102102
toS3GzipChunks: function(event, opts, onFlush) {
103103
return leoS3(this, event, configure, opts, onFlush);
104104
},
105-
toS3: (Bucket, File) => {
105+
toS3: (Bucket, File, opts) => {
106106
var callback = null;
107107
var pass = new PassThrough();
108108
s3.upload({
109+
...opts,
109110
Bucket: Bucket,
110111
Key: File,
111112
Body: pass

0 commit comments

Comments
 (0)