fix: sync config with db only after connection is established #2346

Merged
Sainan merged 1 commits from db-sync-fix into main 2025-06-28 15:08:36 -07:00

View File

@ -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();