diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-06-13 16:46:01 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-13 16:46:01 +0900 |
| commit | 7093662ce5c17a8096c33712d0056de9fd4b5a41 (patch) | |
| tree | a89436b3c3b474a1b1c985876d9e769ea1ac9f9e /packages/backend/src/core/PushNotificationService.ts | |
| parent | Merge pull request #10961 from misskey-dev/develop (diff) | |
| parent | ユーザー統計表示機能を削除 (diff) | |
| download | misskey-7093662ce5c17a8096c33712d0056de9fd4b5a41.tar.gz misskey-7093662ce5c17a8096c33712d0056de9fd4b5a41.tar.bz2 misskey-7093662ce5c17a8096c33712d0056de9fd4b5a41.zip | |
Merge pull request #10990 from misskey-dev/develop
Release: 13.13.2
Diffstat (limited to 'packages/backend/src/core/PushNotificationService.ts')
| -rw-r--r-- | packages/backend/src/core/PushNotificationService.ts | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/packages/backend/src/core/PushNotificationService.ts b/packages/backend/src/core/PushNotificationService.ts index a4c569bdec..15a1d74878 100644 --- a/packages/backend/src/core/PushNotificationService.ts +++ b/packages/backend/src/core/PushNotificationService.ts @@ -1,4 +1,4 @@ -import { Inject, Injectable } from '@nestjs/common'; +import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import push from 'web-push'; import * as Redis from 'ioredis'; import { DI } from '@/di-symbols.js'; @@ -42,7 +42,7 @@ function truncateBody<T extends keyof PushNotificationsTypes>(type: T, body: Pus } @Injectable() -export class PushNotificationService { +export class PushNotificationService implements OnApplicationShutdown { private subscriptionsCache: RedisKVCache<SwSubscription[]>; constructor( @@ -115,4 +115,14 @@ export class PushNotificationService { }); } } + + @bindThis + public dispose(): void { + this.subscriptionsCache.dispose(); + } + + @bindThis + public onApplicationShutdown(signal?: string | undefined): void { + this.dispose(); + } } |