mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
vjudge: luogu: fix setInterval
This commit is contained in:
1 parent
cfc74f0fc5
commit
89833491ed
1 file changed
+1
-1
@@ -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');
|
||||
|
||||
Reference in new issue
Block a user