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/NoteReadService.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 | sharkey-0ed2a220f43d967fa340e7ed62d0d3cbb156ceb8.tar.gz sharkey-0ed2a220f43d967fa340e7ed62d0d3cbb156ceb8.tar.bz2 sharkey-0ed2a220f43d967fa340e7ed62d0d3cbb156ceb8.zip | |
Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop
Diffstat (limited to 'packages/backend/src/core/NoteReadService.ts')
| -rw-r--r-- | packages/backend/src/core/NoteReadService.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/backend/src/core/NoteReadService.ts b/packages/backend/src/core/NoteReadService.ts index 03c1735e04..c73cf76592 100644 --- a/packages/backend/src/core/NoteReadService.ts +++ b/packages/backend/src/core/NoteReadService.ts @@ -14,6 +14,7 @@ import { IdService } from '@/core/IdService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import type { NoteUnreadsRepository, MutingsRepository, NoteThreadMutingsRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; +import { trackPromise } from '@/misc/promise-tracker.js'; @Injectable() export class NoteReadService implements OnApplicationShutdown { @@ -107,7 +108,7 @@ export class NoteReadService implements OnApplicationShutdown { // TODO: ↓まとめてクエリしたい - this.noteUnreadsRepository.countBy({ + trackPromise(this.noteUnreadsRepository.countBy({ userId: userId, isMentioned: true, }).then(mentionsCount => { @@ -115,9 +116,9 @@ export class NoteReadService implements OnApplicationShutdown { // 全て既読になったイベントを発行 this.globalEventService.publishMainStream(userId, 'readAllUnreadMentions'); } - }); + })); - this.noteUnreadsRepository.countBy({ + trackPromise(this.noteUnreadsRepository.countBy({ userId: userId, isSpecified: true, }).then(specifiedCount => { @@ -125,7 +126,7 @@ export class NoteReadService implements OnApplicationShutdown { // 全て既読になったイベントを発行 this.globalEventService.publishMainStream(userId, 'readAllUnreadSpecifiedNotes'); } - }); + })); } } |