From fef7601433e9cab630d89b5e57984e9d5fa5ef1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Fern=C3=A1ndez=20Capel?= Date: Fri, 23 Mar 2018 10:02:11 +0000 Subject: [PATCH] Early return only applies to fault tolerant request We need to return the data to other requests like getLastOccurrence. --- .../Features/Analytics/AnalyticsManager.coffee | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee b/services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee index c8cafc52d5..ebb985f7b5 100644 --- a/services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee +++ b/services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee @@ -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'))