From 24f920d65b31f9eb83c1ecda36adf7f9e2c379c3 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sun, 2 Oct 2022 22:25:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20Should=20run=20sync=20pac?= =?UTF-8?q?kage=20on=20all=20worker=20(#323)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cnpm/cnpmcore/blob/0d8a667b3fdc4cef0958353d92f407b766cc6b9f/app/schedule/SyncPackageWorker.ts#L10 --- app/port/schedule/SyncPackageWorker.ts | 4 ++-- config/config.default.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/port/schedule/SyncPackageWorker.ts b/app/port/schedule/SyncPackageWorker.ts index 59928534..3bd93a8c 100644 --- a/app/port/schedule/SyncPackageWorker.ts +++ b/app/port/schedule/SyncPackageWorker.ts @@ -7,9 +7,9 @@ import { PackageSyncerService } from '../../core/service/PackageSyncerService'; let executingCount = 0; @Schedule({ - type: ScheduleType.WORKER, + type: ScheduleType.ALL, scheduleData: { - interval: 60000, + interval: 1000, }, }) export class SyncPackageWorker { diff --git a/config/config.default.ts b/config/config.default.ts index 5247c2d3..ab5eeb0c 100644 --- a/config/config.default.ts +++ b/config/config.default.ts @@ -24,7 +24,7 @@ export default (appInfo: EggAppConfig) => { // - exist: only sync exist packages, effected when `enableCheckRecentlyUpdated` or `enableChangesStream` is enabled syncMode: 'none', hookEnable: false, - syncPackageWorkerMaxConcurrentTasks: 20, + syncPackageWorkerMaxConcurrentTasks: 10, triggerHookWorkerMaxConcurrentTasks: 10, createTriggerHookWorkerMaxConcurrentTasks: 10, // stop syncing these packages in future