Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
write(cb) {
cb = cb || function(){};
redis.set(this._key, phpjs.serialize(this._store), cb);
}
}
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);
}
});
});