aboutsummaryrefslogtreecommitdiff
path: root/src/tasks/updateCache.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-26 20:07:19 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-26 20:07:19 -0400
commited59b7f1827ab93573b079144c3eeaa01ce40492 (patch)
tree7ceac6d61a8a25586ab9bbaf7acfbade91c97132 /src/tasks/updateCache.ts
parentc0a81b014a56e4d44c826f78391a930361aab122 (diff)
downloadtanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.tar.gz
tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.tar.bz2
tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.zip
clean up, bug fixes
Diffstat (limited to 'src/tasks/updateCache.ts')
-rw-r--r--src/tasks/updateCache.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tasks/updateCache.ts b/src/tasks/updateCache.ts
index b8df336..11d6ca9 100644
--- a/src/tasks/updateCache.ts
+++ b/src/tasks/updateCache.ts
@@ -9,18 +9,18 @@ export default class UpdateCacheTask extends BushTask {
runOnStart: false // done in preinit task
});
}
- public override async exec(): Promise<void> {
+ public override async exec() {
await UpdateCacheTask.updateGlobalCache(client);
await UpdateCacheTask.#updateGuildCache(client);
void client.logger.verbose(`UpdateCache`, `Updated cache.`);
}
- public static async init(client: BushClient): Promise<void> {
+ public static async init(client: BushClient) {
await UpdateCacheTask.updateGlobalCache(client);
await UpdateCacheTask.#updateGuildCache(client);
}
- private static async updateGlobalCache(client: BushClient): Promise<void> {
+ private static async updateGlobalCache(client: BushClient) {
const environment = config.environment;
const row: { [x: string]: any } = ((await Global.findByPk(environment)) ?? (await Global.create({ environment }))).toJSON();
@@ -32,7 +32,7 @@ export default class UpdateCacheTask extends BushTask {
}
}
- static async #updateGuildCache(client: BushClient): Promise<void> {
+ static async #updateGuildCache(client: BushClient) {
const rows = await Guild.findAll();
for (const row of rows) {
client.cache.guilds.set(row.id, row.toJSON() as Guild);