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,22 @@
import { createSystemUser } from "./create-system-user.js";
import { Users } from "../models/index.js";
import { Cache } from "../misc/cache.js";
import { IsNull } from "typeorm";
const ACTOR_USERNAME = "instance.actor";
const cache = new Cache("instanceActor", 60 * 30);
export async function getInstanceActor() {
const cached = await cache.get(null, true);
if (cached) return cached;
const user = await Users.findOneBy({
host: IsNull(),
username: ACTOR_USERNAME
});
if (user) {
await cache.set(null, user);
return user;
} else {
const created = await createSystemUser(ACTOR_USERNAME);
await cache.set(null, created);
return created;
}
}