mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 13:13:45 -05:00
Fix the checkIfFileExists API.
This commit is contained in:
parent
3b6270236c
commit
81a7203315
1 changed files with 1 additions and 0 deletions
|
@ -80,6 +80,7 @@ module.exports =
|
||||||
logger.log bucketName:bucketName, key:key, "check file existence in s3"
|
logger.log bucketName:bucketName, key:key, "check file existence in s3"
|
||||||
s3.headObject {Bucket: bucketName, Key: key}, (err, data) ->
|
s3.headObject {Bucket: bucketName, Key: key}, (err, data) ->
|
||||||
if err?
|
if err?
|
||||||
|
return (callback null, false) if err.code == 'NotFound'
|
||||||
logger.err err:err, bucketName:bucketName, key:key, "something went wrong checking head in s3"
|
logger.err err:err, bucketName:bucketName, key:key, "something went wrong checking head in s3"
|
||||||
return callback err
|
return callback err
|
||||||
callback null, data.ETag?
|
callback null, data.ETag?
|
||||||
|
|
Loading…
Reference in a new issue