Quellcode durchsuchen

fix off-by-one error in error count

Brian Gough vor 9 Jahren
Ursprung
Commit
9c7494eb67
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      libraries/logger/logging-manager.coffee

+ 2 - 2
libraries/logger/logging-manager.coffee

@@ -71,9 +71,9 @@ module.exports = Logger =
 				@lastErrorCount = 0
 				@lastErrorCount = 0
 				@lastErrorTimeStamp = now
 				@lastErrorTimeStamp = now
 			# only report 5 errors every minute to avoid overload
 			# only report 5 errors every minute to avoid overload
-			if @lastErrorCount <= MAX_ERRORS
+			if @lastErrorCount < MAX_ERRORS
 				# add a note if the rate limit has been hit
 				# add a note if the rate limit has been hit
-				note = if @lastErrorCount is MAX_ERRORS then "(rate limited)" else ""
+				note = if @lastErrorCount+1 is MAX_ERRORS then "(rate limited)" else ""
 				# report the exception
 				# report the exception
 				@captureException(attributes, message, "error#{note}")
 				@captureException(attributes, message, "error#{note}")
 	err: () ->
 	err: () ->