Merge pull request #440 from sharelatex/afc-fix-read-announcements-count

Fix read announcements count
This commit is contained in:
James Allen 2018-03-23 12:06:49 +00:00 committed by GitHub
commit 0c89f488bd

View file

@ -17,17 +17,17 @@ makeFaultTolerantRequest = (userId, options, callback) ->
if settings.overleaf?
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)->
if settings.apis?.analytics?.url?
urlPath = opts.url
opts.url = "#{settings.apis.analytics.url}#{urlPath}"
request opts, (err) ->
if err?
logger.err { err: err }, 'Request to analytics failed'
callback() # Do not wait for all the attempts
request opts, callback
else
callback(new Errors.ServiceNotConfiguredError('Analytics service not configured'))