diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2024-01-08 12:46:23 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2024-01-08 12:46:23 +0900 |
| commit | 0ed2a220f43d967fa340e7ed62d0d3cbb156ceb8 (patch) | |
| tree | 12a134c507472b53d33e279d64434ada445016e3 /packages/backend/src/core/NotificationService.ts | |
| parent | enhance(frontend): add game bgm and refactor sound system (diff) | |
| parent | refactor: make sure promises are settled before app shutdown (#12942) (diff) | |
| download | misskey-0ed2a220f43d967fa340e7ed62d0d3cbb156ceb8.tar.gz misskey-0ed2a220f43d967fa340e7ed62d0d3cbb156ceb8.tar.bz2 misskey-0ed2a220f43d967fa340e7ed62d0d3cbb156ceb8.zip | |
Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop
Diffstat (limited to 'packages/backend/src/core/NotificationService.ts')
| -rw-r--r-- | packages/backend/src/core/NotificationService.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/packages/backend/src/core/NotificationService.ts b/packages/backend/src/core/NotificationService.ts index ad7be83e5b..765fcae063 100644 --- a/packages/backend/src/core/NotificationService.ts +++ b/packages/backend/src/core/NotificationService.ts @@ -20,6 +20,7 @@ import { CacheService } from '@/core/CacheService.js'; import type { Config } from '@/config.js'; import { UserListService } from '@/core/UserListService.js'; import type { FilterUnionByProperty } from '@/types.js'; +import { trackPromise } from '@/misc/promise-tracker.js'; @Injectable() export class NotificationService implements OnApplicationShutdown { @@ -74,7 +75,18 @@ export class NotificationService implements OnApplicationShutdown { } @bindThis - public async createNotification<T extends MiNotification['type']>( + public createNotification<T extends MiNotification['type']>( + notifieeId: MiUser['id'], + type: T, + data: Omit<FilterUnionByProperty<MiNotification, 'type', T>, 'type' | 'id' | 'createdAt' | 'notifierId'>, + notifierId?: MiUser['id'] | null, + ) { + trackPromise( + this.#createNotificationInternal(notifieeId, type, data, notifierId), + ); + } + + async #createNotificationInternal<T extends MiNotification['type']>( notifieeId: MiUser['id'], type: T, data: Omit<FilterUnionByProperty<MiNotification, 'type', T>, 'type' | 'id' | 'createdAt' | 'notifierId'>, |