|
@@ -183,6 +183,18 @@ class default_1 {
|
|
|
constructor(opt) {
|
|
|
this.launch = () => {
|
|
|
this.webshot = new webshot_1.default(this.wsUrl, this.mode, () => {
|
|
|
+ const subscribedIds = this.lock.feed.map(feed => this.lock.threads[feed].id.toString());
|
|
|
+ for (const id in this.cache) {
|
|
|
+ if (this.cache[id].pullOrder !== 0 && !subscribedIds.includes(id)) {
|
|
|
+ logger.warn(`disabling pull job of unsubscribed user @${this.cache[id].user.username}`);
|
|
|
+ this.cache[id].pullOrder = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const userIdCache = this.pullOrders;
|
|
|
+ if (Object.values(userIdCache).length !== userIdCache.length) {
|
|
|
+ this.pullOrders = utils_1.Arr.shuffle(userIdCache);
|
|
|
+ fs.writeFileSync(path.resolve(this.cachefile), JSON.stringify(this.cache));
|
|
|
+ }
|
|
|
setTimeout(this.workForAll, this.workInterval * 1000 / this.lock.feed.length);
|
|
|
setTimeout(() => {
|
|
|
this.work();
|