mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-25 03:17:38 -07:00
[backend] Reset home timeline query heuristic after importing follows
This commit is contained in:
parent
09afdeb04c
commit
e2b7d80871
2 changed files with 3 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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<number>("homeTlQueryData", 60 * 60 * 24);
|
||||
export const cache = new Cache<number>("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");
|
||||
|
||||
|
|
Loading…
Reference in a new issue