mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-01 19:23:57 -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 req
|
||||||
requestDomain.add res
|
requestDomain.add res
|
||||||
requestDomain.on "error", (err)->
|
requestDomain.on "error", (err)->
|
||||||
|
setTimeout(->
|
||||||
if !res.finished
|
if !res.finished
|
||||||
res.send(500)
|
res.send(500)
|
||||||
|
, 3000)
|
||||||
logger = require('logger-sharelatex')
|
logger = require('logger-sharelatex')
|
||||||
req =
|
req =
|
||||||
body:req.body
|
body:req.body
|
||||||
|
|
|
@ -15,7 +15,8 @@ module.exports =
|
||||||
FileHandler.getFile bucket, key, {format:format,style:style}, (err, fileStream)->
|
FileHandler.getFile bucket, key, {format:format,style:style}, (err, fileStream)->
|
||||||
if err?
|
if err?
|
||||||
logger.err err:err, key:key, bucket:bucket, format:format, style:style, "problem getting file"
|
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
|
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"
|
logger.log key:key, bucket:bucket, format:format, style:style, "request is only for cache warm so not sending stream"
|
||||||
res.send 200
|
res.send 200
|
||||||
|
|
Loading…
Reference in a new issue