summaryrefslogtreecommitdiff
path: root/bucky/db/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-12-15 10:43:52 +0100
committerJules Laplace <julescarbon@gmail.com>2017-12-15 10:43:52 +0100
commita239f46aaf924031ea53a95130215a2dd3f4dbd6 (patch)
treecc8bcfa9edc0da11f0f756c16d43def5d32eceae /bucky/db/index.js
parent8c0196b973d936a8659bb27d5f189410bc5f8ea6 (diff)
blobbyblob
Diffstat (limited to 'bucky/db/index.js')
-rw-r--r--bucky/db/index.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/bucky/db/index.js b/bucky/db/index.js
index 74ff788..20628bb 100644
--- a/bucky/db/index.js
+++ b/bucky/db/index.js
@@ -139,7 +139,7 @@ db.getFileCounts = function(ids){
return knex.column('thread').count('* as count').select().from('files').where('thread', 'in', ids).groupBy('thread')
}
db.getFileSizes = function(ids){
- return knex.column('thread').sum('size as size').select().from('files').where('thread', 'in', ids).groupBy('thread')
+ return knex.column('thread').sum('size as size').count('* as count').select().from('files').where('thread', 'in', ids).groupBy('thread')
}
db.getFilesById = function(ids){
return File.where("id", "in", ids).fetchAll()
@@ -159,7 +159,7 @@ db.destroyFiles = function(files){
return resolve()
}
var filePath = '/bucky/data/' + thread_id + '/' + filename
- console.log(filePath)
+ console.log('delete', filePath)
s3client.deleteFile(filePath, function(err, res){
// check `err`, then do `res.pipe(..)` or `res.resume()` or whatever.
resolve()