aboutsummaryrefslogtreecommitdiff
path: root/src/tasks/updateCache.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-24 15:58:13 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-24 15:58:13 -0400
commit423fb144a0209c7acb74dc756faa37e19b7aa905 (patch)
tree0b1af0e794efabf51ee0f86c3b56cd66627f619a /src/tasks/updateCache.ts
parent9390b3f59b18dc3576f9c169c8fc586be14bcdc5 (diff)
downloadtanzanite-423fb144a0209c7acb74dc756faa37e19b7aa905.tar.gz
tanzanite-423fb144a0209c7acb74dc756faa37e19b7aa905.tar.bz2
tanzanite-423fb144a0209c7acb74dc756faa37e19b7aa905.zip
some fixes and hacky fetch member work arround
Diffstat (limited to 'src/tasks/updateCache.ts')
-rw-r--r--src/tasks/updateCache.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tasks/updateCache.ts b/src/tasks/updateCache.ts
index 7fb7eb3..69919d8 100644
--- a/src/tasks/updateCache.ts
+++ b/src/tasks/updateCache.ts
@@ -24,11 +24,13 @@ export class UpdateCacheTask extends BushTask {
private static async updateGlobalCache(client: BushClient): Promise<void> {
const environment = config.environment;
- const row = ((await Global.findByPk(environment)) ?? (await Global.create({ environment }))).toJSON();
+ const row: { [x: string]: any } = ((await Global.findByPk(environment)) ?? (await Global.create({ environment }))).toJSON();
for (const option in row) {
- if (Object.keys(client.cache.global).includes(option))
- client.cache.global[option as keyof typeof client.cache.global] = row[option as keyof typeof row];
+ if (Object.keys(client.cache.global).includes(option)) {
+ client.cache.global[option as keyof typeof client.cache.global] = row[option];
+ if (option === 'superUsers') client.superUserID = row[option];
+ }
}
}