aboutsummaryrefslogtreecommitdiff
path: root/src/tasks
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
parentc0a81b014a56e4d44c826f78391a930361aab122 (diff)
downloadtanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.tar.gz
tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.tar.bz2
tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.zip
clean up, bug fixes
Diffstat (limited to 'src/tasks')
-rw-r--r--src/tasks/cpuUsage.ts2
-rw-r--r--src/tasks/removeExpiredPunishements.ts2
-rw-r--r--src/tasks/updateCache.ts8
-rw-r--r--src/tasks/updateStats.ts2
-rw-r--r--src/tasks/updateSuperUsers.ts2
5 files changed, 8 insertions, 8 deletions
diff --git a/src/tasks/cpuUsage.ts b/src/tasks/cpuUsage.ts
index a7398d7..b22923a 100644
--- a/src/tasks/cpuUsage.ts
+++ b/src/tasks/cpuUsage.ts
@@ -8,7 +8,7 @@ export default class CpuUsageTask extends BushTask {
runOnStart: true
});
}
- public override async exec(): Promise<void> {
+ public override async exec() {
const cpu = await osu.cpu.usage(client.stats.cpu === undefined ? 100 : 60_000);
client.stats.cpu = cpu;
}
diff --git a/src/tasks/removeExpiredPunishements.ts b/src/tasks/removeExpiredPunishements.ts
index a5f9d73..b39cdb7 100644
--- a/src/tasks/removeExpiredPunishements.ts
+++ b/src/tasks/removeExpiredPunishements.ts
@@ -8,7 +8,7 @@ export default class RemoveExpiredPunishmentsTask extends BushTask {
runOnStart: true
});
}
- public override async exec(): Promise<void> {
+ public override async exec() {
const expiredEntries = await ActivePunishment.findAll({
where: {
expires: {
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);
diff --git a/src/tasks/updateStats.ts b/src/tasks/updateStats.ts
index 74a8114..ad3cb45 100644
--- a/src/tasks/updateStats.ts
+++ b/src/tasks/updateStats.ts
@@ -8,7 +8,7 @@ export default class UpdateStatsTask extends BushTask {
runOnStart: true
});
}
- public override async exec(): Promise<void> {
+ public override async exec() {
const row =
(await Stat.findByPk(client.config.environment)) ?? (await Stat.create({ environment: client.config.environment }));
row.commandsUsed = client.stats.commandsUsed;
diff --git a/src/tasks/updateSuperUsers.ts b/src/tasks/updateSuperUsers.ts
index e0e51f5..19dbb1e 100644
--- a/src/tasks/updateSuperUsers.ts
+++ b/src/tasks/updateSuperUsers.ts
@@ -8,7 +8,7 @@ export default class UpdateSuperUsersTask extends BushTask {
runOnStart: true
});
}
- public override async exec(): Promise<void> {
+ public override async exec() {
const superUsers = client.guilds.cache
.get(client.config.supportGuild.id)
?.members.cache.filter(