save(input, entities) {
    if (!this[client] || !this[client].isConnected()) return;
    let type = (input.role_id ? 'role' : 'user'),
      hashKey = this.getHashField(input.access_id, type),
      hashField = (type === 'role' ? input.role_id : input.user_id),
      hashValue;
    try {
      hashValue = JSON.stringify(entities);
    } catch (e) {
      return;
    }
    this[client].exec('HSET', hashKey, hashField, hashValue, (err) => {
      if (err) {
        logger.warn(`Could not save IAM to redis.`);
      }
      this.expire(hashKey);
    });
  }
/*
   * SAVE the given data to cache, with the given input.
   * */
SAVE the given data to cache, with the given input.
SAVE the given data to cache with the given input .
save(input, entities) {
    if (!this[client] || !this[client].isConnected()) return;
    let type = (input.role_id ? 'role' : 'user'),
      hashKey = this.getHashField(input.access_id, type),
      hashField = (type === 'role' ? input.role_id : input.user_id),
      hashValue;
    try {
      hashValue = JSON.stringify(entities);
    } catch (e) {
      return;
    }
    this[client].exec('HSET', hashKey, hashField, hashValue, (err) => {
      if (err) {
        logger.warn(`Could not save IAM to redis.`);
      }
      this.expire(hashKey);
    });
  }
save ( input , entities ) { if ( ! this [ client ] || ! this [ client ] . isConnected ( ) ) return ; let type = ( input . role_id ? 'role' : 'user' ) , hashKey = this . getHashField ( input . access_id , type ) , hashField = ( type === 'role' ? input . role_id : input . user_id ) , hashValue ; try { hashValue = JSON . stringify ( entities ) ; } catch ( e ) { return ; } this [ client ] . exec ( 'HSET' , hashKey , hashField , hashValue , ( err ) => { if ( err ) { logger . warn ( ` ` ) ; } this . expire ( hashKey ) ; } ) ; }
SAVE the given data to cache, with the given input.
SAVE the given data to cache with the given input .