Fix "Bus error: 10"

This commit is contained in:
haad 2016-03-05 12:56:45 +01:00
parent 9e00aab161
commit c588f23248

View File

@ -22,10 +22,7 @@ class OrbitClient {
if(subscribe === undefined) subscribe = true;
this.db.use(channel, this.user, password);
this.db.events.on('data', async((hash) => {
await(this._pubsub.publish(channel, hash));
this.events.emit('data', channel, hash);
}));
this.db.events.on('data', (hash) => this._pubsub.publish(channel, hash));
if(subscribe)
this._pubsub.subscribe(channel, password, async((channel, message) => this.db.sync(channel, message)));