Skip to content

Commit 98dca2b

Browse files
fix: shutdown microservice if ijson connection lost
1 parent 64e96b6 commit 98dca2b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/services/abstract-microservice.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -839,9 +839,10 @@ abstract class AbstractMicroservice {
839839
const workers = _.times(count, (num) => this.runWorker(num + 1));
840840
const eventWorkers = _.times(eventCount, (num) => this.runEventWorker(num + 1));
841841

842-
return Promise.all([...workers, ...eventWorkers]).catch((e) =>
843-
this.logDriver(() => `${name} shutdown: ${e.message as string}`, LogType.ERROR),
844-
);
842+
return Promise.all([...workers, ...eventWorkers]).catch((e) => {
843+
this.logDriver(() => `${name} shutdown: ${e.message as string}`, LogType.ERROR);
844+
process.exit(1);
845+
});
845846
}
846847
}
847848

0 commit comments

Comments
 (0)