diff --git a/packages/backend/src/misc/fetch-meta.ts b/packages/backend/src/misc/fetch-meta.ts deleted file mode 100644 index c31e2e89..00000000 --- a/packages/backend/src/misc/fetch-meta.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { fetchMeta } from "@/misc/backend-rs.js"; - -// refresh cache -setInterval(() => fetchMeta(true), 1000 * 10); diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts b/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts index fd4ad940..c5b4783c 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/hosted.ts @@ -2,6 +2,7 @@ import config from "@/config/index.js"; import { Meta } from "@/models/entities/meta.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { db } from "@/db/postgre.js"; +import { fetchMeta } from "@/misc/backend-rs.js"; import define from "@/server/api/define.js"; export const meta = { @@ -120,6 +121,8 @@ export default define(meta, paramDef, async (ps, me) => { } else { await transactionalEntityManager.save(Meta, set); } + // update meta cache + fetchMeta(true); }); insertModerationLog(me, "updateMeta"); } diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index f0e83192..ce803bb3 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -1,6 +1,7 @@ import { Meta } from "@/models/entities/meta.js"; import { insertModerationLog } from "@/services/insert-moderation-log.js"; import { db } from "@/db/postgre.js"; +import { fetchMeta } from "@/misc/backend-rs.js"; import define from "@/server/api/define.js"; export const meta = { @@ -571,6 +572,8 @@ export default define(meta, paramDef, async (ps, me) => { } else { await transactionalEntityManager.save(Meta, set); } + // update meta cache + fetchMeta(true); }); insertModerationLog(me, "updateMeta");