Skip to content

Commit

Permalink
wireup when storage is already connected
Browse files Browse the repository at this point in the history
  • Loading branch information
Micah Riggan committed Dec 27, 2018
1 parent 1283790 commit ac395a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/bitcore-node/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const runWorker = async () => {
};

const start = async () => {
await Storage.start({});
await Storage.start();
Event.start();
if (cluster.isMaster) {
await runMaster();
Expand Down
8 changes: 6 additions & 2 deletions packages/bitcore-node/src/services/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ export class EventService {
}
logger.info('Starting Event Service');
this.stopped = false;
this.storageService.connection.on('CONNECTED', () => {
if (this.storageService.connected) {
this.wireup();
});
} else {
this.storageService.connection.on('CONNECTED', () => {
this.wireup();
});
}
}

stop() {
Expand Down

0 comments on commit ac395a5

Please sign in to comment.