Skip to content

Commit 0b1eccc

Browse files
committed
✨ Добавлена синхронизация индексов для DAL в процессе инициализации приложения, улучшая взаимодействие с базой данных MongoDB.
1 parent 29e53f6 commit 0b1eccc

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/app/zygote.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { config } from "@/shared/config/config";
22
import { mongo } from "@/shared/infra/mongo";
33
import { redis } from "@/shared/infra/redis";
4+
import { di } from "@/shared/injection";
45
import { logger } from "@/shared/lib/logger";
56
import { createContainer } from "./container";
67
import { startServer } from "./server/serve";
@@ -23,5 +24,12 @@ export const initialize = async (): Promise<void> => {
2324
operation: "create",
2425
});
2526

27+
await Promise.all([di.userDal, di.cockDal, di.achievementDal].map((token) => container.resolve(token).syncIndexes()));
28+
29+
logger.info("Indexes synced", {
30+
service: "mongo",
31+
operation: "sync_indexes",
32+
});
33+
2634
await startServer(container);
2735
};

0 commit comments

Comments
 (0)