vjudge: luogu: fix setInterval

This commit is contained in:
undefined committed 2021-10-10 11:19:11 +08:00
1 parent cfc74f0fc5
commit 89833491ed
1 file changed
+1 -1
+1 -1
View File
@@ -35,6 +35,7 @@ const UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
export default class LuoguProvider implements IBasicProvider {
constructor(public account: RemoteAccount, private save: (data: any) => Promise<void>) {
if (account.cookie) this.cookie = account.cookie;
setInterval(() => this.getCsrfToken('/'), 5 * 60 * 1000);
}
cookie: string[] = [];
@@ -77,7 +78,6 @@ export default class LuoguProvider implements IBasicProvider {
async ensureLogin() {
if (await this.loggedIn) {
this.getCsrfToken('/');
setInterval(() => this.getCsrfToken('/'), 5 * 60 * 1000);
return true;
}
logger.info('retry login');