Skip to content

Commit

Permalink
don't return db during building
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarrazin committed May 3, 2024
1 parent cedb0c5 commit 9e00109
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/server/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type { MigrationResult } from "$lib/types/MigrationResult";
import type { Semaphore } from "$lib/types/Semaphore";
import type { AssistantStats } from "$lib/types/AssistantStats";
import { logger } from "$lib/server/logger";
import { building } from "$app/environment";

export const CONVERSATION_STATS_COLLECTION = "conversations.stats";

Expand Down Expand Up @@ -203,4 +204,6 @@ export class Database {
}
}

export const collections = Database.getInstance().getCollections();
export const collections = building
? ({} as unknown as ReturnType<typeof Database.prototype.getCollections>)
: Database.getInstance().getCollections();

0 comments on commit 9e00109

Please sign in to comment.