Skip to content

Commit

Permalink
Merge pull request #4514 from novuhq/fix-self-hosted-metrics-services…
Browse files Browse the repository at this point in the history
…-shutdown

fix(worker): self hosted metrics services were not shutdown properly
  • Loading branch information
Pablo Fernández authored Oct 16, 2023
2 parents 26ffab9 + 72cbb3f commit f612e91
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,12 @@ export class ActiveJobsMetricService {
public async gracefulShutdown(): Promise<void> {
Logger.log('Shutting the Active Jobs Metric service down', LOG_CONTEXT);

await this.activeJobsMetricQueueService.gracefulShutdown();
await this.activeJobsMetricWorkerService.gracefulShutdown();
if (this.activeJobsMetricQueueService) {
await this.activeJobsMetricQueueService.gracefulShutdown();
}
if (this.activeJobsMetricWorkerService) {
await this.activeJobsMetricWorkerService.gracefulShutdown();
}

Logger.log('Shutting down the Active Jobs Metric service has finished', LOG_CONTEXT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,12 @@ export class CompletedJobsMetricService {
public async gracefulShutdown(): Promise<void> {
Logger.log('Shutting the Completed Jobs Metric service down', LOG_CONTEXT);

await this.completedJobsMetricQueueService.gracefulShutdown();
await this.completedJobsMetricWorkerService.gracefulShutdown();
if (this.completedJobsMetricQueueService) {
await this.completedJobsMetricQueueService.gracefulShutdown();
}
if (this.completedJobsMetricWorkerService) {
await this.completedJobsMetricWorkerService.gracefulShutdown();
}

Logger.log('Shutting down the Completed Jobs Metric service has finished', LOG_CONTEXT);
}
Expand Down

0 comments on commit f612e91

Please sign in to comment.