How to use the redis.set function in redis

To help you get started, we’ve selected a few redis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DragonsInn / BIRD3 / app / Backend / Service / Web.js View on Github external
write(cb) {
                cb = cb || function(){};
                redis.set(this._key, phpjs.serialize(this._store), cb);
            }
        }
github emmorts / lolapi / lib / util.js View on Github external
callback(null, null);
          return;
        }

        try {
          data = JSON.parse(data);
        } catch (error) {
          callback('Unable to parse data received from the server', null);
          return;
        }

        if (data.status && data.status.status_code !== 200) {
          callback(data.status.status_code + ' ' + data.status.message, null);
        } else {
          if (_useRedis || options.cacheRequest) {
            redis.set(options.uri, JSON.stringify(data));
            redis.expire(options.uri, _cacheTTL);
          }

          callback(null, data);
        }
      });
    });