B2G/gecko/services/aitc/modules/client.js
// Before making a request, check if we are allowed to.
Before making a request, check if we are allowed to.
Before making a request check if we are allowed to .
function _isRequestAllowed() {
    if (!this._backoff) {
      return true;
    }
    let time = Date.now();
    let backoff = parseInt(this._state.get("backoff", 0), 10);
    if (time < backoff) {
      this._log.warn(backoff - time + "ms left for backoff, aborting request");
      return false;
    }
    this._backoff = false;
    this._state.set("backoff", "0");
    return true;
  }
function _isRequestAllowed ( ) { if ( ! this . _backoff ) { return true ; } let time = Date . now ( ) ; let backoff = parseInt ( this . _state . get ( "backoff" , 0 ) , 10 ) ; if ( time < backoff ) { this . _log . warn ( backoff - time + "ms left for backoff, aborting request" ) ; return false ; } this . _backoff = false ; this . _state . set ( "backoff" , "0" ) ; return true ; }
Before making a request, check if we are allowed to.
Before making a request check if we are allowed to .