From 0948a71a40ac4897d129ef56830665dc028f07c7 Mon Sep 17 00:00:00 2001 From: killa Date: Fri, 24 Jun 2022 16:22:32 +0800 Subject: [PATCH] feat: read enableChangesStream when sync changes stream (#250) --- app/core/service/ChangesStreamService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/core/service/ChangesStreamService.ts b/app/core/service/ChangesStreamService.ts index ae2a47f4..b50b3ba4 100644 --- a/app/core/service/ChangesStreamService.ts +++ b/app/core/service/ChangesStreamService.ts @@ -62,7 +62,8 @@ export class ChangesStreamService extends AbstractService { this.logger.warn('[ChangesStreamService.executeTask:firstSeq] GET %s status: %s, data: %j, since: %s', changesStreamRegistry, status, data, since); } - while (since) { + // allow disable changesStream dynamic + while (since && this.config.cnpmcore.enableChangesStream) { const { lastSince, taskCount } = await this.handleChanges(since, task); this.logger.warn('[ChangesStreamService.executeTask:changes] since: %s => %s, %d new tasks, taskId: %s, updatedAt: %j', since, lastSince, taskCount, task.taskId, task.updatedAt);