fix x2 autorelease interval
parent
33101429a9
commit
a7759abeee
|
@ -6,8 +6,8 @@ import { CloudServicesUtil } from '../util';
|
|||
|
||||
let interval: NodeJS.Timeout;
|
||||
|
||||
export default function checkLock(client: Client): NodeJS.Timeout {
|
||||
interval = setInterval(async () => {
|
||||
export default async function checkLock(client: Client) {
|
||||
async function start() {
|
||||
try {
|
||||
const moderations = await client.db.Moderation.find();
|
||||
const judgements = await client.db.Judgement.find().lean().exec();
|
||||
|
@ -59,6 +59,10 @@ export default function checkLock(client: Client): NodeJS.Timeout {
|
|||
} catch (error) {
|
||||
await client.util.handleError(error);
|
||||
}
|
||||
}
|
||||
await start();
|
||||
interval = setInterval(async () => {
|
||||
await start();
|
||||
}, 10000);
|
||||
return interval;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue