B2G/gecko/services/aitc/modules/storage.js
/**
   * Put an array into the cache file. Will throw an exception if there is
   * an error while trying to write to the file.
   */
Put an array into the cache file. Will throw an exception if there is
an error while trying to write to the file.
Put an array into the cache file . Will throw an exception if there is an error while trying to write to the file .
function _putFile(value, cb) {
    if (this._writeLock) {
      throw new Error("_putFile already in progress");
    }
    this._writeLock = true;
    this._log.info("Writing queue to disk");
    CommonUtils.jsonSave(this._filePath, this, value, function jsonSaved(err) {
      if (err) {
        let msg = new Error("_putFile failed with " + err);
        this._writeLock = false;
        cb(msg);
        return;
      }
      this._log.info("_putFile succeeded");
      this._writeLock = false;
      cb(null);
    });
  }
function _putFile ( value , cb ) { if ( this . _writeLock ) { throw new Error ( "_putFile already in progress" ) ; } this . _writeLock = true ; this . _log . info ( "Writing queue to disk" ) ; CommonUtils . jsonSave ( this . _filePath , this , value , function jsonSaved ( err ) { if ( err ) { let msg = new Error ( "_putFile failed with " + err ) ; this . _writeLock = false ; cb ( msg ) ; return ; } this . _log . info ( "_putFile succeeded" ) ; this . _writeLock = false ; cb ( null ) ; } ) ; }
Put an array into the cache file.
Put an array into the cache file .