mirror of
https://github.com/docmost/docmost.git
synced 2026-05-13 11:44:07 +08:00
Merge branch 'main' into base
This commit is contained in:
@@ -1,10 +1,4 @@
|
||||
import {
|
||||
Global,
|
||||
Logger,
|
||||
Module,
|
||||
OnApplicationBootstrap,
|
||||
BeforeApplicationShutdown,
|
||||
} from '@nestjs/common';
|
||||
import { Global, Logger, Module, OnApplicationBootstrap } from '@nestjs/common';
|
||||
import { InjectKysely, KyselyModule } from 'nestjs-kysely';
|
||||
import { EnvironmentService } from '../integrations/environment/environment.service';
|
||||
import { CamelCasePlugin, LogEvent, sql } from 'kysely';
|
||||
@@ -15,6 +9,7 @@ import { GroupUserRepo } from '@docmost/db/repos/group/group-user.repo';
|
||||
import { SpaceRepo } from '@docmost/db/repos/space/space.repo';
|
||||
import { SpaceMemberRepo } from '@docmost/db/repos/space/space-member.repo';
|
||||
import { PageRepo } from './repos/page/page.repo';
|
||||
import { PagePermissionRepo } from './repos/page/page-permission.repo';
|
||||
import { CommentRepo } from './repos/comment/comment.repo';
|
||||
import { PageHistoryRepo } from './repos/page/page-history.repo';
|
||||
import { AttachmentRepo } from './repos/attachment/attachment.repo';
|
||||
@@ -80,6 +75,7 @@ import { normalizePostgresUrl } from '../common/helpers';
|
||||
SpaceRepo,
|
||||
SpaceMemberRepo,
|
||||
PageRepo,
|
||||
PagePermissionRepo,
|
||||
PageHistoryRepo,
|
||||
CommentRepo,
|
||||
AttachmentRepo,
|
||||
@@ -102,6 +98,7 @@ import { normalizePostgresUrl } from '../common/helpers';
|
||||
SpaceRepo,
|
||||
SpaceMemberRepo,
|
||||
PageRepo,
|
||||
PagePermissionRepo,
|
||||
PageHistoryRepo,
|
||||
CommentRepo,
|
||||
AttachmentRepo,
|
||||
@@ -116,9 +113,7 @@ import { normalizePostgresUrl } from '../common/helpers';
|
||||
BaseViewRepo,
|
||||
],
|
||||
})
|
||||
export class DatabaseModule
|
||||
implements OnApplicationBootstrap, BeforeApplicationShutdown
|
||||
{
|
||||
export class DatabaseModule implements OnApplicationBootstrap {
|
||||
private readonly logger = new Logger(DatabaseModule.name);
|
||||
|
||||
constructor(
|
||||
@@ -135,12 +130,6 @@ export class DatabaseModule
|
||||
}
|
||||
}
|
||||
|
||||
async beforeApplicationShutdown(): Promise<void> {
|
||||
if (this.db) {
|
||||
await this.db.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
async establishConnection() {
|
||||
const retryAttempts = 15;
|
||||
const retryDelay = 3000;
|
||||
|
||||
Reference in New Issue
Block a user