fix: sync config with db only after connection is established
All checks were successful
Build / build (pull_request) Successful in 55s

The error message had regressed in the case where connection could not be established.
This commit is contained in:
Sainan 2025-06-28 21:30:16 +02:00
parent c4c622d82b
commit e92f238f7d

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