Skip to content

Commit

Permalink
fix: ignore HttpClientRequestTimeoutError on change stream worker (#601)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Oct 26, 2023
1 parent e01d39e commit 0791769
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/core/service/ChangesStreamService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,12 @@ export class ChangesStreamService extends AbstractService {
await setTimeout(this.config.cnpmcore.checkChangesStreamInterval);
}
} catch (err) {
this.logger.error('[ChangesStreamService.executeTask:error] %s, exit now', err);
this.logger.error(err);
this.logger.warn('[ChangesStreamService.executeTask:error] %s, exit now', err.message);
if (err.name === 'HttpClientRequestTimeoutError') {
this.logger.warn(err);
} else {
this.logger.error(err);
}
task.error = `${err}`;
await this.taskRepository.saveTask(task);
await this.suspendSync();
Expand Down

0 comments on commit 0791769

Please sign in to comment.