mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-11 06:45:11 +00:00
Make the retry-on-fail behaviour optional
This commit is contained in:
parent
1c15e0966c
commit
8117061674
1 changed files with 3 additions and 1 deletions
|
@ -14,7 +14,7 @@ makeRequest = (opts, callback)->
|
|||
_go = () ->
|
||||
request opts, (err, response, data) ->
|
||||
if err?
|
||||
if iteration == retryTimings.length
|
||||
if iteration == retryTimings.length or !opts.retryOnFail
|
||||
logger.err {err, url: opts.url},
|
||||
"Error in analytics request, retries failed"
|
||||
return callback(err)
|
||||
|
@ -51,6 +51,7 @@ module.exports =
|
|||
method:"POST"
|
||||
timeout:1000
|
||||
url: "/user/#{user_id}/event"
|
||||
retryOnFail: true
|
||||
if settings.overleaf?
|
||||
opts.qs = {fromV2: 1}
|
||||
makeRequest opts, callback
|
||||
|
@ -68,6 +69,7 @@ module.exports =
|
|||
qs:
|
||||
userId: userId
|
||||
projectId: projectId
|
||||
retryOnFail: true
|
||||
if settings.overleaf?
|
||||
opts.qs.fromV2 = 1
|
||||
makeRequest opts, callback
|
||||
|
|
Loading…
Add table
Reference in a new issue