refactor: config init event for first config load (#13930)

This commit is contained in:
Zack Pollard 2024-11-05 16:30:56 +00:00 committed by GitHub
parent c383e115af
commit d456d35510
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 160 additions and 146 deletions

View file

@ -9,6 +9,7 @@ import {
VectorExtension,
VectorIndex,
} from 'src/interfaces/database.interface';
import { BootstrapEventPriority } from 'src/interfaces/event.interface';
import { BaseService } from 'src/services/base.service';
type CreateFailedArgs = { name: string; extension: string; otherName: string };
@ -64,7 +65,7 @@ const RETRY_DURATION = Duration.fromObject({ seconds: 5 });
export class DatabaseService extends BaseService {
private reconnection?: NodeJS.Timeout;
@OnEvent({ name: 'app.bootstrap', priority: -200 })
@OnEvent({ name: 'app.bootstrap', priority: BootstrapEventPriority.DatabaseService })
async onBootstrap() {
const version = await this.databaseRepository.getPostgresVersion();
const current = semver.coerce(version);