server/serverMethods.js
// and if it's big we don't want to look too impatient).
and if it's big we don't want to look too impatient).
and if it ' s big we don ' t want to look too impatient ) .
function _launchArchivePolling(aOtInstance, aArchiveId, aTimeout, aTimeoutMultiplier) {
    return new Promise((resolve) => {
      var timeout = aTimeout;
      var pollArchive = function _pollArchive() {
        logger.log('Poll [', aArchiveId, ']: polling...');
        aOtInstance.getArchive_P(aArchiveId).then((aArchive) => {
          if (aArchive.status === 'available' || aArchive.status === 'uploaded') {
            logger.log('Poll [', aArchiveId, ']: Resolving with', aArchive.status);
            resolve(aArchive);
          } else {
            timeout *= aTimeoutMultiplier;
            logger.log('Poll [', aArchiveId, ']: Retrying in', timeout);
            setTimeout(_pollArchive, timeout);
          }
        });
      };
      logger.log('Poll [', aArchiveId, ']: Setting first try for', timeout);
      setTimeout(pollArchive, timeout);
    });
  }
function _launchArchivePolling ( aOtInstance , aArchiveId , aTimeout , aTimeoutMultiplier ) { return new Promise ( ( resolve ) => { var timeout = aTimeout ; var pollArchive = function _pollArchive ( ) { logger . log ( 'Poll [' , aArchiveId , ']: polling...' ) ; aOtInstance . getArchive_P ( aArchiveId ) . then ( ( aArchive ) => { if ( aArchive . status === 'available' || aArchive . status === 'uploaded' ) { logger . log ( 'Poll [' , aArchiveId , ']: Resolving with' , aArchive . status ) ; resolve ( aArchive ) ; } else { timeout *= aTimeoutMultiplier ; logger . log ( 'Poll [' , aArchiveId , ']: Retrying in' , timeout ) ; setTimeout ( _pollArchive , timeout ) ; } } ) ; } ; logger . log ( 'Poll [' , aArchiveId , ']: Setting first try for' , timeout ) ; setTimeout ( pollArchive , timeout ) ; } ) ; }
and if it's big we don't want to look too impatient).
and if it ' s big we don ' t want to look too impatient ) .