Fixed 267U.pre2

This commit is contained in:
2026-07-26 18:25:37 +09:00
parent 50bfaeafdf
commit 317d00a284
1286 changed files with 80222 additions and 1 deletions
@@ -0,0 +1,21 @@
import { In } from "typeorm";
import { Mutings } from "../../../models/index.js";
import { queueLogger } from "../../logger.js";
import { publishUserEvent } from "../../../services/stream.js";
const logger = queueLogger.createSubLogger("check-expired-mutings");
export async function checkExpiredMutings() {
logger.info("Checking expired mutings...");
const expired = await Mutings.createQueryBuilder("muting").where("muting.expiresAt IS NOT NULL").andWhere("muting.expiresAt < :now", {
now: new Date()
}).innerJoinAndSelect("muting.mutee", "mutee").getMany();
if (expired.length > 0) {
await Mutings.delete({
id: In(expired.map((m)=>m.id))
});
for (const m of expired){
publishUserEvent(m.muterId, "unmute", m.mutee);
}
}
logger.succ("All expired mutings checked.");
return "Success";
}