From 758a1455b1ca7564a496d53c625d3b4fae3f256f Mon Sep 17 00:00:00 2001 From: tokebe <43009413+tokebe@users.noreply.github.com> Date: Fri, 19 Apr 2024 16:46:03 -0400 Subject: [PATCH] fix: only one process syncs --- packages/server/src/controllers/cron/update_local_smartapi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/controllers/cron/update_local_smartapi.ts b/packages/server/src/controllers/cron/update_local_smartapi.ts index 058bf24..558acfa 100644 --- a/packages/server/src/controllers/cron/update_local_smartapi.ts +++ b/packages/server/src/controllers/cron/update_local_smartapi.ts @@ -410,7 +410,7 @@ export default function manageSmartApi() { [ process.env.SMARTAPI_SYNC !== "false", // Shouldn't be explicitly disabled process.env.NODE_ENV === "production", // Should be in production mode - process.env.INSTANCE_ID !== "0", // Only one PM2 cluster instance should sync + process.env.INSTANCE_ID && process.env.INSTANCE_ID === "0", // Only one PM2 cluster instance should sync ].every(condition => condition); if (!should_sync) {