fix x2 autorelease interval
parent
33101429a9
commit
a7759abeee
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue