Compare commits
No commits in common. "c462f6bef53fdbcc2c1ae3a116764d59aea8c8df" and "e6bad780ee1e0c8713bf35cc0e9f0decfb806543" have entirely different histories.
c462f6bef5
...
e6bad780ee
@ -35,7 +35,6 @@ class UploadManager extends EventEmitter {
|
|||||||
this.cancelledJobIds = new Set();
|
this.cancelledJobIds = new Set();
|
||||||
this.sessionBytes = 0;
|
this.sessionBytes = 0;
|
||||||
this.lastStartTime = {}; // hoster -> timestamp of last upload start
|
this.lastStartTime = {}; // hoster -> timestamp of last upload start
|
||||||
this.intervalLocks = {}; // hoster -> Promise chain for serialized interval waits
|
|
||||||
this.globalThrottle = null;
|
this.globalThrottle = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -545,10 +544,7 @@ class UploadManager extends EventEmitter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_waitForInterval(hoster, intervalMs, signal) {
|
async _waitForInterval(hoster, intervalMs, signal) {
|
||||||
// Serialize interval waits per hoster so concurrent jobs queue up properly
|
|
||||||
const prev = this.intervalLocks[hoster] || Promise.resolve();
|
|
||||||
const next = prev.then(async () => {
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const last = this.lastStartTime[hoster] || 0;
|
const last = this.lastStartTime[hoster] || 0;
|
||||||
const elapsed = now - last;
|
const elapsed = now - last;
|
||||||
@ -556,9 +552,6 @@ class UploadManager extends EventEmitter {
|
|||||||
await this._sleep(intervalMs - elapsed, signal);
|
await this._sleep(intervalMs - elapsed, signal);
|
||||||
}
|
}
|
||||||
this.lastStartTime[hoster] = Date.now();
|
this.lastStartTime[hoster] = Date.now();
|
||||||
});
|
|
||||||
this.intervalLocks[hoster] = next.catch(() => {});
|
|
||||||
return next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cancelJobs(jobIds) {
|
cancelJobs(jobIds) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-hoster-uploader",
|
"name": "multi-hoster-uploader",
|
||||||
"version": "1.6.6",
|
"version": "1.6.5",
|
||||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user