From e92f238f7dd7dac78d8d78c2b1fea429d4df0ac5 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sat, 28 Jun 2025 21:30:16 +0200 Subject: [PATCH] fix: sync config with db only after connection is established The error message had regressed in the case where connection could not be established. --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index f9d671a2..53dfcd90 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,12 +28,13 @@ import { updateWorldStateCollections } from "./services/worldStateService"; JSON.stringify = JSONStringify; validateConfig(); -syncConfigWithDatabase(); mongoose .connect(config.mongodbUrl) .then(() => { logger.info("Connected to MongoDB"); + syncConfigWithDatabase(); + startWebServer(); void updateWorldStateCollections();