refactor(server): events (#13003)

* refactor(server): events

* chore: better type

---------

Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
This commit is contained in:
Jason Rasmussen 2024-09-30 10:35:11 -04:00 committed by GitHub
parent 95c67949f7
commit a2d457b01d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 260 additions and 259 deletions

View file

@ -1,7 +1,7 @@
import { Inject, Injectable } from '@nestjs/common';
import { Duration } from 'luxon';
import semver from 'semver';
import { OnEmit } from 'src/decorators';
import { OnEvent } from 'src/decorators';
import { IConfigRepository } from 'src/interfaces/config.interface';
import {
DatabaseExtension,
@ -74,7 +74,7 @@ export class DatabaseService {
this.logger.setContext(DatabaseService.name);
}
@OnEmit({ event: 'app.bootstrap', priority: -200 })
@OnEvent({ name: 'app.bootstrap', priority: -200 })
async onBootstrap() {
const version = await this.databaseRepository.getPostgresVersion();
const current = semver.coerce(version);