Skip to content

Commit

Permalink
fix: add wait on first connect to true for pod health check not to re…
Browse files Browse the repository at this point in the history
…port connection error restarts
  • Loading branch information
mishraomp committed Dec 25, 2024
1 parent 31b73ae commit d0e8184
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions webeoc/src/publishers/actions-taken-publisher.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class ActionsTakenPublisherService {
private async initializeNATS() {
const nc = await connect({
servers: [process.env.NATS_HOST],
waitOnFirstConnect: true,
});
this.jsClient = nc.jetstream();
}
Expand Down
2 changes: 1 addition & 1 deletion webeoc/src/subscribers/actions-taken-subscriber.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ActionsTakenSubscriberService implements OnModuleInit {

async onModuleInit() {
try {
this.natsConnection = await connect({ servers: process.env.NATS_HOST });
this.natsConnection = await connect({ servers: process.env.NATS_HOST, waitOnFirstConnect: true });
this.jsm = await this.natsConnection.jetstreamManager();
await this.setupStream();
await this.subscribeToTopics();
Expand Down

0 comments on commit d0e8184

Please sign in to comment.