use HourlyCron instead of own timeout for proxycheck key refresh
This commit is contained in:
parent
9699d0f08f
commit
dde8eba9bc
|
@ -7,6 +7,7 @@
|
|||
import https from 'https';
|
||||
|
||||
import { HOUR } from '../core/constants';
|
||||
import { HourlyCron } from './cron';
|
||||
|
||||
|
||||
/*
|
||||
|
@ -41,7 +42,7 @@ class PcKeyProvider {
|
|||
this.disabledKeys = [];
|
||||
this.logger = logger;
|
||||
this.getKeysUsage(keys);
|
||||
setInterval(this.updateKeys, 1 * HOUR);
|
||||
HourlyCron.hook(this.updateKeys);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -195,6 +196,13 @@ class PcKeyProvider {
|
|||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* wrapper to update keys
|
||||
*/
|
||||
updateKeys() {
|
||||
this.pcKeyProvider.updateKeys();
|
||||
}
|
||||
|
||||
/*
|
||||
* report denied key (over daily quota, rate limited, blocked,...)
|
||||
* @param key
|
||||
|
|
Loading…
Reference in New Issue
Block a user