mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
do not log warning in dev/tests (#1830)
do not log warning in dev/tests GitOrigin-RevId: c46664779fe939ad0f39466f43eb24381a245b55
This commit is contained in:
parent
35138e6763
commit
48b5c7e209
1 changed files with 10 additions and 4 deletions
|
@ -19,6 +19,10 @@ const _ = require('underscore')
|
|||
const request = require('requestretry')
|
||||
const Errors = require('../Errors/Errors')
|
||||
|
||||
const isProduction =
|
||||
(process.env['NODE_ENV'] || '').toLowerCase() === 'production'
|
||||
const isTest = process.env['MOCHA_GREP'] !== undefined
|
||||
|
||||
const makeFaultTolerantRequest = function(userId, options, callback) {
|
||||
if (
|
||||
userId + '' ===
|
||||
|
@ -76,10 +80,12 @@ var exponentialBackoffStrategy = function() {
|
|||
var exponentialBackoffDelay = function(attempts) {
|
||||
const delay = Math.pow(2, attempts) * 1000
|
||||
|
||||
logger.warn(
|
||||
'Error comunicating with the analytics service. ' +
|
||||
`Will try again attempt ${attempts} in ${delay}ms`
|
||||
)
|
||||
if (isProduction && !isTest) {
|
||||
logger.warn(
|
||||
'Error comunicating with the analytics service. ' +
|
||||
`Will try again attempt ${attempts} in ${delay}ms`
|
||||
)
|
||||
}
|
||||
|
||||
return delay
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue