diff --git a/packages/backend/src/queue/processors/db/import-following.ts b/packages/backend/src/queue/processors/db/import-following.ts index b1a7cd2c9..d58c71276 100644 --- a/packages/backend/src/queue/processors/db/import-following.ts +++ b/packages/backend/src/queue/processors/db/import-following.ts @@ -9,6 +9,7 @@ import { Users, DriveFiles } from "@/models/index.js"; import type { DbUserImportJobData } from "@/queue/types.js"; import { queueLogger } from "../../logger.js"; import type Bull from "bull"; +import { cache as heuristic } from "@/server/api/common/generate-following-query.js"; const logger = queueLogger.createSubLogger("import-following"); @@ -111,6 +112,7 @@ export async function importFollowing( } } + await heuristic.delete(user.id); logger.succ("Imported"); done(); } diff --git a/packages/backend/src/server/api/common/generate-following-query.ts b/packages/backend/src/server/api/common/generate-following-query.ts index 14835f7f5..c6a592d34 100644 --- a/packages/backend/src/server/api/common/generate-following-query.ts +++ b/packages/backend/src/server/api/common/generate-following-query.ts @@ -4,7 +4,7 @@ import { Followings, Notes } from "@/models/index.js"; import { Cache } from "@/misc/cache.js"; import { apiLogger } from "@/server/api/logger.js"; -const cache = new Cache("homeTlQueryData", 60 * 60 * 24); +export const cache = new Cache("homeTlQueryData", 60 * 60 * 24); const cutoff = 250; // 250 posts in the last 7 days, constant determined by comparing benchmarks for cutoff values between 100 and 2500 const logger = apiLogger.createSubLogger("heuristics");