UNPKG

crypto-nodes

Version:

32 lines (19 loc) 674 B
var redis = require("redis"); var redis_locks = { init: function () { this.client = redis.createClient('6379', process.env.REDIS_SERVER || 'node1.builder-apps.org', { password: process.env.REDIS_PASSWORD }); this.client.on("error", function (err) { console.log("Redis client error :: " + err); }); }, order_get: function () { // Will Only return order if no other process is working on the order // Throws error after 5 second timeout }, order_set: function () { // Will Only set order if this process exclusively is working on the order // Throws error after 5 second timeout }, } redis_locks.init(); module.exports = redis_locks;