summaryrefslogtreecommitdiff
path: root/packages/backend/src/core
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-09-05 15:03:50 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-09-05 15:03:50 +0900
commitf53cffaeb29a5663e28259e8eab85a15b1cb9044 (patch)
tree97e212674b678991665dd6ca215a2ef677ceffb5 /packages/backend/src/core
parent(ad) translation for deck column settings (#11778) (diff)
downloadsharkey-f53cffaeb29a5663e28259e8eab85a15b1cb9044.tar.gz
sharkey-f53cffaeb29a5663e28259e8eab85a15b1cb9044.tar.bz2
sharkey-f53cffaeb29a5663e28259e8eab85a15b1cb9044.zip
enhance(backend): タイムライン等の有効期限を設定可能に
Resolve #11773
Diffstat (limited to 'packages/backend/src/core')
-rw-r--r--packages/backend/src/core/NoteCreateService.ts2
-rw-r--r--packages/backend/src/core/NotificationService.ts6
2 files changed, 6 insertions, 2 deletions
diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts
index 2ccc610cf3..dc440f5681 100644
--- a/packages/backend/src/core/NoteCreateService.ts
+++ b/packages/backend/src/core/NoteCreateService.ts
@@ -334,7 +334,7 @@ export class NoteCreateService implements OnApplicationShutdown {
if (data.channel) {
this.redisClient.xadd(
`channelTimeline:${data.channel.id}`,
- 'MAXLEN', '~', '1000',
+ 'MAXLEN', '~', this.config.perChannelMaxNoteCacheCount.toString(),
'*',
'note', note.id);
}
diff --git a/packages/backend/src/core/NotificationService.ts b/packages/backend/src/core/NotificationService.ts
index 02c577c199..aa4e22f893 100644
--- a/packages/backend/src/core/NotificationService.ts
+++ b/packages/backend/src/core/NotificationService.ts
@@ -17,12 +17,16 @@ import { PushNotificationService } from '@/core/PushNotificationService.js';
import { NotificationEntityService } from '@/core/entities/NotificationEntityService.js';
import { IdService } from '@/core/IdService.js';
import { CacheService } from '@/core/CacheService.js';
+import { Config } from '@/config.js';
@Injectable()
export class NotificationService implements OnApplicationShutdown {
#shutdownController = new AbortController();
constructor(
+ @Inject(DI.config)
+ private config: Config,
+
@Inject(DI.redis)
private redisClient: Redis.Redis,
@@ -96,7 +100,7 @@ export class NotificationService implements OnApplicationShutdown {
const redisIdPromise = this.redisClient.xadd(
`notificationTimeline:${notifieeId}`,
- 'MAXLEN', '~', '300',
+ 'MAXLEN', '~', this.config.perUserNotificationsMaxCount.toString(),
'*',
'data', JSON.stringify(notification));