diff options
Diffstat (limited to 'bucky/db')
| -rw-r--r-- | bucky/db/index.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bucky/db/index.js b/bucky/db/index.js index 51c024b..5e21603 100644 --- a/bucky/db/index.js +++ b/bucky/db/index.js @@ -172,8 +172,8 @@ db.destroyFile = function(id){ } db.moveFile = function(file, thread_id){ var s3client = upload.client() - var srcPath = '/bucky/data/' + file.get('thread') + '/' + file.get('filename') - var destPath = '/bucky/data/' + thread_id + '/' + file.get('filename') + var srcPath = process.env.S3_PATH + '/data/' + file.get('thread') + '/' + file.get('filename') + var destPath = process.env.S3_PATH + '/data/' + thread_id + '/' + file.get('filename') console.log('moving', srcPath, 'to', destPath) var copyPromise = new Promise((resolve, reject) => { s3client.copy(srcPath, destPath).on('response', function(res){ @@ -207,7 +207,7 @@ db.destroyFiles = function(files){ if (! thread_id || ! filename) { return resolve() } - var filePath = '/bucky/data/' + thread_id + '/' + filename + var filePath = process.env.S3_PATH + '/data/' + thread_id + '/' + filename console.log('delete', filePath) s3client.deleteFile(filePath, function(err, res){ // check `err`, then do `res.pipe(..)` or `res.resume()` or whatever. |
