some hacky fix

This commit is contained in:
ITOH
2021-05-29 21:09:07 +02:00
parent 63b42112ae
commit d5e3315b98
3 changed files with 28 additions and 16 deletions
+14 -1
View File
@@ -6,4 +6,17 @@ import "./util/validate_length.ts";
import "./util/loop_object.ts";
// Final cleanup
import "./stop_sweepers.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);
}
+14 -1
View File
@@ -74,4 +74,17 @@ import "./discoveries/valid_discovery_term.ts";
// Final cleanup
import "./guilds/delete_guild.ts";
import "./ws/ws_close.ts";
import "./stop_sweepers.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);
}
-14
View File
@@ -1,14 +0,0 @@
import { cache } from "../src/cache.ts";
// Exit the Deno process once all tests are done.
Deno.test({
name: "[chache] Stop all sweepers manually.",
fn() {
// clear all the sweeper intervals
for (const c of Object.values(cache)) {
if (!(c instanceof Map)) continue;
c.stopSweeper();
}
},
});