Add more logging and don't delete temp files

This commit is contained in:
James Allen 2014-06-02 16:49:49 +01:00
parent e529875245
commit 415d937f84

View file

@ -49,9 +49,9 @@ module.exports =
if res.statusCode != 200 if res.statusCode != 200
logger.err bucketName:bucketName, key:key, fsPath:fsPath, "non 200 response from s3 putting file" logger.err bucketName:bucketName, key:key, fsPath:fsPath, "non 200 response from s3 putting file"
return callback("non 200 response from s3 on put file") return callback("non 200 response from s3 on put file")
LocalFileWriter.deleteFile fsPath, (err)-> #LocalFileWriter.deleteFile fsPath, (err)->
logger.log res:res, bucketName:bucketName, key:key, fsPath:fsPath,"file uploaded to s3" logger.log res:res, bucketName:bucketName, key:key, fsPath:fsPath,"file uploaded to s3"
callback(err) callback(err)
putEventEmiter.on "error", (err)-> putEventEmiter.on "error", (err)->
logger.err err:err, bucketName:bucketName, key:key, fsPath:fsPath, "error emmited on put of file" logger.err err:err, bucketName:bucketName, key:key, fsPath:fsPath, "error emmited on put of file"
callback err callback err
@ -100,7 +100,12 @@ module.exports =
logger.err err:err, res:res, bucketName:bucketName, key:key, "something went wrong deleting file in aws" logger.err err:err, res:res, bucketName:bucketName, key:key, "something went wrong deleting file in aws"
callback(err) callback(err)
deleteDirectory: (bucketName, key, callback)-> deleteDirectory: (bucketName, key, _callback)->
callback = (args...) ->
logger.log key: key, bucketName: bucketName, "calling delete callback"
_callback(args...)
logger.log key: key, bucketName: bucketName, "deleting directory"
s3Client = knox.createClient s3Client = knox.createClient
key: settings.filestore.s3.key key: settings.filestore.s3.key
secret: settings.filestore.s3.secret secret: settings.filestore.s3.secret