lib/type/hash.js
function setExpiry(key, ms, req) {
  var rval = this.getRawKey(key);
  if(rval === undefined) return 0;
  // expiry is in the past or now, delete immediately
  // but return 1 to indicate the expiry was set
  if(ms <= Date.now()) {
    this.delKey(key, req);
    return 1;
  }
  if(!this._expires[key]) {
    this._ekeys.push(key);
  }
  this._expires[key] = ms;
  rval.e = ms;
  return 1;
}
function setExpiry(key, ms, req) {
  var rval = this.getRawKey(key);
  if(rval === undefined) return 0;
  // expiry is in the past or now, delete immediately
  // but return 1 to indicate the expiry was set
  if(ms <= Date.now()) {
    this.delKey(key, req);
    return 1;
  }
  if(!this._expires[key]) {
    this._ekeys.push(key);
  }
  this._expires[key] = ms;
  rval.e = ms;
  return 1;
}
function setExpiry ( key , ms , req ) { var rval = this . getRawKey ( key ) ; if ( rval === undefined ) return 0 ; // expiry is in the past or now, delete immediately // but return 1 to indicate the expiry was set if ( ms <= Date . now ( ) ) { this . delKey ( key , req ) ; return 1 ; } if ( ! this . _expires [ key ] ) { this . _ekeys . push ( key ) ; } this . _expires [ key ] = ms ; rval . e = ms ; return 1 ; }
Set expiry on a key as a unix timestamp in ms.
Set expiry on a key as a unix timestamp in ms .