Fix S3 connection errors causing crashes
This commit is contained in:
parent
14f62ac072
commit
78f4c15929
4 changed files with 194 additions and 189 deletions
|
@ -22,13 +22,15 @@ export function get(key) {
|
|||
});
|
||||
}
|
||||
|
||||
export function upload(stream, key, callback) {
|
||||
export function upload(stream, key) {
|
||||
debug(`sending to s3: uploads/'${key}`);
|
||||
const params = { Bucket: process.env.AWS_BUCKET, Key: `uploads/${key}`, Body: stream };
|
||||
const uploading = s3.upload(params);
|
||||
uploading.on('error', (err) => {
|
||||
debug('S3 Error', err);
|
||||
});
|
||||
uploading.send(callback);
|
||||
uploading.send((err) => {
|
||||
debug('S3 Connection Error', err);
|
||||
});
|
||||
return uploading;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue