Merge pull request #1000 from discordeno/implement-sweeper

add: sweepers
This commit is contained in:
ITOH
2021-05-29 21:15:08 +02:00
committed by GitHub
8 changed files with 187 additions and 7 deletions
+19
View File
@@ -1,3 +1,22 @@
// THE ORDER OF THE IMPORTS IN THIS FILE MATTER!
// DO NOT MOVE THEM UNLESS YOU KNOW WHAT YOUR DOING!
import "./util/utils.ts";
import "./util/validate_length.ts";
import "./util/loop_object.ts";
// Final cleanup
import { cache } from "../src/cache.ts";
import { delay } from "../src/util/utils.ts";
if (import.meta.main) {
// clear all the sweeper intervals
for (const c of Object.values(cache)) {
if (!(c instanceof Map)) continue;
c.stopSweeper();
console.log("Cleaned");
}
await delay(3000);
}
+14
View File
@@ -74,3 +74,17 @@ import "./discoveries/valid_discovery_term.ts";
// Final cleanup
import "./guilds/delete_guild.ts";
import "./ws/ws_close.ts";
import { cache } from "../src/cache.ts";
import { delay } from "../src/util/utils.ts";
if (import.meta.main) {
// clear all the sweeper intervals
for (const c of Object.values(cache)) {
if (!(c instanceof Map)) continue;
c.stopSweeper();
console.log("Cleaned");
}
await delay(3000);
}