@@ -61,8 +61,7 @@ function Raven() {
6161 this . _keypressTimeout ;
6262 this . _location = _window . location ;
6363 this . _lastHref = this . _location && this . _location . href ;
64- this . _backoffDuration = 0 ;
65- this . _backoffStart = null ;
64+ this . _resetBackoff ( ) ;
6665
6766 for ( var method in this . _originalConsole ) { // eslint-disable-line guard-for-in
6867 this . _originalConsoleMethods [ method ] = this . _originalConsole [ method ] ;
@@ -199,6 +198,10 @@ Raven.prototype = {
199198
200199 self . _globalEndpoint = self . _globalServer +
201200 '/' + path + 'api/' + self . _globalProject + '/store/' ;
201+
202+ // Reset backoff state since we may be pointing at a
203+ // new project/server
204+ this . _resetBackoff ( ) ;
202205 } ,
203206
204207 /*
@@ -1322,6 +1325,11 @@ Raven.prototype = {
13221325 return httpData ;
13231326 } ,
13241327
1328+ _resetBackoff : function ( ) {
1329+ this . _backoffDuration = 0 ;
1330+ this . _backoffStart = null ;
1331+ } ,
1332+
13251333 _shouldBackoff : function ( ) {
13261334 return this . _backoffDuration && now ( ) - this . _backoffStart < this . _backoffDuration ;
13271335 } ,
@@ -1480,8 +1488,7 @@ Raven.prototype = {
14801488 data : data ,
14811489 options : globalOptions ,
14821490 onSuccess : function success ( ) {
1483- self . _backoffDuration = 0 ;
1484- self . _backoffStart = null ;
1491+ self . _resetBackoff ( ) ;
14851492
14861493 self . _triggerEvent ( 'success' , {
14871494 data : data ,
0 commit comments