Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
fix: handle metrics collector errors
Browse files Browse the repository at this point in the history
  • Loading branch information
s-r-x committed May 11, 2022
1 parent 522cf37 commit cee357b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/root/src/metrics-collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ export class MetricsCollector {
}
}
private _taskFn = async () => {
const metrics = await this._collect();
await this._persist(metrics);
try {
const metrics = await this._collect();
await this._persist(metrics);
} catch (e) {
console.error('[bull-monitor] metrics collector error: ', e);
}
};
private async _collect(): Promise<TMetrics[]> {
const timestamp = Date.now();
Expand Down

0 comments on commit cee357b

Please sign in to comment.