fix x2 autorelease interval

master
Matthew 2022-02-03 14:58:59 -05:00
parent 33101429a9
commit a7759abeee
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 6 additions and 2 deletions

View File

@ -6,8 +6,8 @@ import { CloudServicesUtil } from '../util';
let interval: NodeJS.Timeout; let interval: NodeJS.Timeout;
export default function checkLock(client: Client): NodeJS.Timeout { export default async function checkLock(client: Client) {
interval = setInterval(async () => { async function start() {
try { try {
const moderations = await client.db.Moderation.find(); const moderations = await client.db.Moderation.find();
const judgements = await client.db.Judgement.find().lean().exec(); const judgements = await client.db.Judgement.find().lean().exec();
@ -59,6 +59,10 @@ export default function checkLock(client: Client): NodeJS.Timeout {
} catch (error) { } catch (error) {
await client.util.handleError(error); await client.util.handleError(error);
} }
}
await start();
interval = setInterval(async () => {
await start();
}, 10000); }, 10000);
return interval; return interval;
} }