Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

revert(chat): drop the boot-time Mastra storage init

Nevo David1207941bb900
diff --git a/libraries/nestjs-libraries/src/chat/mastra.service.ts b/libraries/nestjs-libraries/src/chat/mastra.service.ts
index b40e3f9ac..27f1b0a36 100644
--- a/libraries/nestjs-libraries/src/chat/mastra.service.ts
+++ b/libraries/nestjs-libraries/src/chat/mastra.service.ts
@@ -1,7 +1,7 @@
import { Mastra } from '@mastra/core/mastra';
import { ConsoleLogger } from '@mastra/core/logger';
import { pStore } from '@gitroom/nestjs-libraries/chat/mastra.store';
-import { Injectable, Logger } from '@nestjs/common';
+import { Injectable } from '@nestjs/common';
import { LoadToolsService } from '@gitroom/nestjs-libraries/chat/load.tools.service';
@Injectable()
@@ -9,15 +9,6 @@ export class MastraService {
static mastra: Mastra;
constructor(private _loadToolsService: LoadToolsService) {}
async mastra() {
- if (!MastraService.mastra) {
- // @mastra/pg migrates its tables on first use, when a few instances boot together
- // the ADD COLUMN can race, the retry runs against the already migrated schema
- await pStore
- .init()
- .catch(() => pStore.init())
- .catch((err) => Logger.warn(`Mastra storage init failed: ${err}`));
- }
-
MastraService.mastra =
MastraService.mastra ||
new Mastra({