fix: sync config with db only after connection is established #2346
@ -28,12 +28,13 @@ import { updateWorldStateCollections } from "./services/worldStateService";
|
|||||||
JSON.stringify = JSONStringify;
|
JSON.stringify = JSONStringify;
|
||||||
|
|
||||||
validateConfig();
|
validateConfig();
|
||||||
syncConfigWithDatabase();
|
|
||||||
|
|
||||||
mongoose
|
mongoose
|
||||||
.connect(config.mongodbUrl)
|
.connect(config.mongodbUrl)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
logger.info("Connected to MongoDB");
|
logger.info("Connected to MongoDB");
|
||||||
|
syncConfigWithDatabase();
|
||||||
|
|
||||||
startWebServer();
|
startWebServer();
|
||||||
|
|
||||||
void updateWorldStateCollections();
|
void updateWorldStateCollections();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user