This commit is contained in:
haad 2016-02-11 09:20:34 +01:00
parent 03ef4fe5ff
commit d60f8d66a2
2 changed files with 7 additions and 8 deletions

View File

@ -179,7 +179,7 @@ class OrbitClient {
// console.log("posting...") // console.log("posting...")
message = this._createMessage(channel, password, operation, key, value); message = this._createMessage(channel, password, operation, key, value);
res = await(this._pubsub.publish(channel, message.hash, message.seq)); res = await(this._pubsub.publish(channel, message.hash, message.seq));
// if(!res) console.log("retry") // if(!res) console.log("retry", message)
} }
// console.log("posted") // console.log("posted")
return message.Hash; return message.Hash;
@ -211,7 +211,6 @@ class OrbitClient {
// this.client = this._pubsub._client; // this.client = this._pubsub._client;
// this.user = this.client.info.user; // this.user = this.client.info.user;
this.user = { id: 'hello' } this.user = { id: 'hello' }
console.log("Connected to redis")
// this.network = { // this.network = {
// id: this.client.info.networkId, // id: this.client.info.networkId,
// name: this.client.info.name, // name: this.client.info.name,

View File

@ -40,13 +40,13 @@ class PubSub {
this.publishQueue.splice(0, 0, { hash: message.Hash, callback: resolve }); this.publishQueue.splice(0, 0, { hash: message.Hash, callback: resolve });
this.client2.publish(hash, JSON.stringify({ hash: message.Hash, seq: seq })); this.client2.publish(hash, JSON.stringify({ hash: message.Hash, seq: seq }));
} else { } else {
console.log("too early") // console.log("too early")
// resolve(false); // resolve(false);
} }
setTimeout(() => { // setTimeout(() => {
this.publishQueue.pop(); // this.publishQueue.pop();
resolve(false); // resolve(false);
}, 2000) // }, 200)
}); });
} }