mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
rate limit on sentry reporting
This commit is contained in:
parent
cf0e106153
commit
6e3f102fb2
1 changed files with 7 additions and 1 deletions
|
@ -54,7 +54,13 @@ module.exports = Logger =
|
|||
@logger.info.apply(@logger, arguments)
|
||||
error: (attributes, message, args...)->
|
||||
@logger.error(attributes, message, args...)
|
||||
@captureException(attributes, message, "error") if @raven?
|
||||
if @raven?
|
||||
now = new Date()
|
||||
rateLimited = (now - @lastErrorTimeStamp) < 30 * 1000
|
||||
# only report one error every thirty seconds to avoid overload
|
||||
if not rateLimited
|
||||
@captureException(attributes, message, "error")
|
||||
@lastErrorTimeStamp = now
|
||||
err: () ->
|
||||
@error.apply(this, arguments)
|
||||
warn: ()->
|
||||
|
|
Loading…
Reference in a new issue