|
@@ -174,12 +174,12 @@ class default_1 {
|
|
|
constructor(opt) {
|
|
|
this.launch = () => {
|
|
|
this.webshot = new webshot_1.default(this.wsUrl, this.mode, () => {
|
|
|
- setTimeout(this.workForAll, this.workInterval * 1000);
|
|
|
+ setTimeout(this.workForAll, this.workInterval * 1000 / this.lock.feed.length);
|
|
|
setTimeout(() => {
|
|
|
this.work();
|
|
|
setInterval(() => { this.pullOrders = utils_1.Arr.shuffle(this.pullOrders); }, 21600000);
|
|
|
- setInterval(this.workForAll, this.workInterval * 10000);
|
|
|
- }, this.workInterval * 1200);
|
|
|
+ setInterval(this.workForAll, this.workInterval * 1000);
|
|
|
+ }, this.workInterval * 1200 / this.lock.feed.length);
|
|
|
});
|
|
|
};
|
|
|
this.queryUser = (rawUserName) => {
|
|
@@ -248,7 +248,7 @@ class default_1 {
|
|
|
thread.updatedAt = (this.cache[idToUserMap[thread.id].username].updated = new Date()).toString();
|
|
|
}
|
|
|
}));
|
|
|
- }), (lp1, lp2) => () => lp1().then(() => util_1.promisify(setTimeout)(this.workInterval * 1000).then(lp2)));
|
|
|
+ }), (lp1, lp2) => () => lp1().then(() => util_1.promisify(setTimeout)(this.workInterval * 1000 / this.lock.feed.length).then(lp2)));
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
if (error instanceof instagram_private_api_1.IgNetworkError) {
|
|
@@ -271,7 +271,7 @@ class default_1 {
|
|
|
setTimeout(() => {
|
|
|
this.workForAll();
|
|
|
setTimeout(this.work, this.workInterval * 200);
|
|
|
- }, this.workInterval * 1000);
|
|
|
+ }, this.workInterval * 1000 / lock.feed.length);
|
|
|
return;
|
|
|
}
|
|
|
if (lock.workon >= lock.feed.length)
|
|
@@ -293,12 +293,12 @@ class default_1 {
|
|
|
if (!match) {
|
|
|
logger.error(`current feed "${currentFeed}" is invalid, please remove this feed manually`);
|
|
|
lock.workon++;
|
|
|
- setTimeout(this.work, this.workInterval * 1000);
|
|
|
+ setTimeout(this.work, this.workInterval * 1000 / lock.feed.length);
|
|
|
return;
|
|
|
}
|
|
|
const cachedFeed = this.cache[match[1]];
|
|
|
if (!cachedFeed) {
|
|
|
- setTimeout(this.work, this.workInterval * 1000);
|
|
|
+ setTimeout(this.work, this.workInterval * 1000 / lock.feed.length);
|
|
|
return;
|
|
|
}
|
|
|
const newer = (item) => utils_1.BigNumOps.compare(item.pk, lock.threads[currentFeed].offset) > 0;
|
|
@@ -380,7 +380,7 @@ class default_1 {
|
|
|
.then(userNameId => {
|
|
|
var _a, _b;
|
|
|
const [userName, userId] = userNameId.split(':');
|
|
|
- if (Date.now() - ((_b = (_a = this.cache[userName]) === null || _a === void 0 ? void 0 : _a.updated) === null || _b === void 0 ? void 0 : _b.getTime()) > this.workInterval * 10000 &&
|
|
|
+ if (Date.now() - ((_b = (_a = this.cache[userName]) === null || _a === void 0 ? void 0 : _a.updated) === null || _b === void 0 ? void 0 : _b.getTime()) > this.workInterval * 1000 &&
|
|
|
Object.keys(this.cache[userName].stories).length > 0) {
|
|
|
return userName;
|
|
|
}
|