mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 22:31:27 -05:00
Early return only applies to fault tolerant request
We need to return the data to other requests like getLastOccurrence.
This commit is contained in:
parent
b1ca81bf2d
commit
fef7601433
1 changed files with 6 additions and 6 deletions
|
@ -17,17 +17,17 @@ makeFaultTolerantRequest = (userId, options, callback) ->
|
||||||
if settings.overleaf?
|
if settings.overleaf?
|
||||||
options.qs = Object.assign({}, options.qs, { fromV2: 1 })
|
options.qs = Object.assign({}, options.qs, { fromV2: 1 })
|
||||||
|
|
||||||
makeRequest(options, callback)
|
makeRequest options, (err) ->
|
||||||
|
if err?
|
||||||
|
logger.err { err: err }, 'Request to analytics failed'
|
||||||
|
|
||||||
|
callback() # Do not wait for all the attempts
|
||||||
|
|
||||||
makeRequest = (opts, callback)->
|
makeRequest = (opts, callback)->
|
||||||
if settings.apis?.analytics?.url?
|
if settings.apis?.analytics?.url?
|
||||||
urlPath = opts.url
|
urlPath = opts.url
|
||||||
opts.url = "#{settings.apis.analytics.url}#{urlPath}"
|
opts.url = "#{settings.apis.analytics.url}#{urlPath}"
|
||||||
request opts, (err) ->
|
request opts, callback
|
||||||
if err?
|
|
||||||
logger.err { err: err }, 'Request to analytics failed'
|
|
||||||
|
|
||||||
callback() # Do not wait for all the attempts
|
|
||||||
else
|
else
|
||||||
callback(new Errors.ServiceNotConfiguredError('Analytics service not configured'))
|
callback(new Errors.ServiceNotConfiguredError('Analytics service not configured'))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue