Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
db.get(keyName).then((value) => {
// console.log('get', keyName, value);
if (value === null || value.time < request.message.time || true) {
value = { time: timetoken, coinCache: request.message.coinCache };
db.set(keyName, value, 1);
// console.log('set', keyName, value);
}
// console.log("value", value);
// console.log('set', keyName, value);
// return request.ok();
pubnub.publish({
channel: 'realtimephaserFire2',
message: { value, fromServer: true }
}).then((publishResponse) => {
// console.log(publishResponse);
});
});
});