3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-07 11:07:19 +00:00

feat: add member cache; handle all role changes with RoleManagerPlugin; exit gracefully

This commit is contained in:
Dragory 2023-05-07 17:56:55 +03:00
parent fd60a09947
commit fa50110766
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
48 changed files with 755 additions and 264 deletions

View file

@ -0,0 +1,13 @@
// tslint:disable:no-console
import { lazyMemoize, MINUTES } from "../../utils";
import { MemberCache } from "../MemberCache";
const LOOP_INTERVAL = 5 * MINUTES;
const getMemberCacheRepository = lazyMemoize(() => new MemberCache());
export async function runMemberCacheDeletionLoop() {
console.log("[MEMBER CACHE DELETION LOOP] Deleting entries marked to be deleted");
await getMemberCacheRepository().deleteMarkedToBeDeletedEntries();
setTimeout(() => runMemberCacheDeletionLoop(), LOOP_INTERVAL);
}