mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
on domain error wait 3 seconds to send 500 to allow for other cleanup.
Also check inside function if the res has finished. #confused
This commit is contained in:
parent
be8fdcfd6a
commit
09224007a7
2 changed files with 6 additions and 3 deletions
|
@ -35,8 +35,10 @@ app.use (req, res, next) ->
|
|||
requestDomain.add req
|
||||
requestDomain.add res
|
||||
requestDomain.on "error", (err)->
|
||||
if !res.finished
|
||||
res.send(500)
|
||||
setTimeout(->
|
||||
if !res.finished
|
||||
res.send(500)
|
||||
, 3000)
|
||||
logger = require('logger-sharelatex')
|
||||
req =
|
||||
body:req.body
|
||||
|
|
|
@ -15,7 +15,8 @@ module.exports =
|
|||
FileHandler.getFile bucket, key, {format:format,style:style}, (err, fileStream)->
|
||||
if err?
|
||||
logger.err err:err, key:key, bucket:bucket, format:format, style:style, "problem getting file"
|
||||
res?.send? 500
|
||||
if !res.finished and res?.send?
|
||||
res.send 500
|
||||
else if req.query.cacheWarm
|
||||
logger.log key:key, bucket:bucket, format:format, style:style, "request is only for cache warm so not sending stream"
|
||||
res.send 200
|
||||
|
|
Loading…
Reference in a new issue