From be517b5fdcef2ed155443d45bebdf36ec05c7c1c Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Thu, 13 Nov 2025 20:08:49 -0500 Subject: [PATCH] remove check-hibernation task, as it's been obsoleted by HibernateUsersProcessorService --- packages/backend/src/core/QueueService.ts | 10 ---------- .../queue/processors/BackgroundTaskProcessorService.ts | 10 ---------- packages/backend/src/queue/types.ts | 1 - 3 files changed, 21 deletions(-) diff --git a/packages/backend/src/core/QueueService.ts b/packages/backend/src/core/QueueService.ts index c9fd4cbd3d..3d1ffcceba 100644 --- a/packages/backend/src/core/QueueService.ts +++ b/packages/backend/src/core/QueueService.ts @@ -877,16 +877,6 @@ export class QueueService implements OnModuleInit { return await this.createBackgroundTask({ type: 'post-note', noteId, silent, edit }, duplication); } - @bindThis - public async createCheckHibernationJob(userId: string) { - return await this.createBackgroundTask( - { type: 'check-hibernation', userId }, - - // This is a very heavy task, so only run once per day per user - { id: `check-hibernation:${userId}`, ttl: 1000 * 60 * 60 * 24 }, - ); - } - @bindThis public async createUpdateUserTagsJob(userId: string) { return await this.createBackgroundTask({ type: 'update-user-tags', userId }, userId); diff --git a/packages/backend/src/queue/processors/BackgroundTaskProcessorService.ts b/packages/backend/src/queue/processors/BackgroundTaskProcessorService.ts index 18706c7158..d25424b02f 100644 --- a/packages/backend/src/queue/processors/BackgroundTaskProcessorService.ts +++ b/packages/backend/src/queue/processors/BackgroundTaskProcessorService.ts @@ -91,8 +91,6 @@ export class BackgroundTaskProcessorService { return await this.processPostInbox(job.data); } else if (job.data.type === 'post-note') { return await this.processPostNote(job.data); - } else if (job.data.type === 'check-hibernation') { - return await this.processCheckHibernation(job.data); } else if (job.data.type === 'delete-file') { return await this.processDeleteFile(job.data); } else if (job.data.type === 'update-latest-note') { @@ -272,14 +270,6 @@ export class BackgroundTaskProcessorService { return 'ok'; } - private async processCheckHibernation(task: CheckHibernationBackgroundTask): Promise { - const followers = await this.cacheService.getNonHibernatedFollowers(task.userId); - if (followers.length < 1) return `Skipping check-hibernation task: user ${task.userId} has no non-hibernated followers`; - - await this.noteCreateService.checkHibernation(followers); - return 'ok'; - } - private async processDeleteFile(task: DeleteFileBackgroundTask): Promise { const file = await this.driveFilesRepository.findOneBy({ id: task.fileId }); if (!file) return `Skipping delete-file task: file ${task.fileId} has been deleted`; diff --git a/packages/backend/src/queue/types.ts b/packages/backend/src/queue/types.ts index cb31e5a3e1..f37ff581a0 100644 --- a/packages/backend/src/queue/types.ts +++ b/packages/backend/src/queue/types.ts @@ -179,7 +179,6 @@ export type BackgroundTaskJobData = PostDeliverBackgroundTask | PostInboxBackgroundTask | PostNoteBackgroundTask | - CheckHibernationBackgroundTask | DeleteFileBackgroundTask | UpdateLatestNoteBackgroundTask | PostSuspendBackgroundTask |