Compare commits
2 Commits
d955403c7a
...
ff2991cabd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff2991cabd | ||
|
|
399e2fbe70 |
@ -239,14 +239,16 @@ class UploadManager extends EventEmitter {
|
|||||||
maxAttempts
|
maxAttempts
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Acquire hoster semaphore first so jobs waiting for a hoster slot
|
||||||
|
// don't waste global slots (prevents underutilization)
|
||||||
|
await hosterSemaphore.acquire(signal);
|
||||||
|
hosterSlotAcquired = true;
|
||||||
|
|
||||||
if (globalSemaphore) {
|
if (globalSemaphore) {
|
||||||
await globalSemaphore.acquire(signal);
|
await globalSemaphore.acquire(signal);
|
||||||
globalSlotAcquired = true;
|
globalSlotAcquired = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
await hosterSemaphore.acquire(signal);
|
|
||||||
hosterSlotAcquired = true;
|
|
||||||
|
|
||||||
if (settings.timeIntervalSec > 0) {
|
if (settings.timeIntervalSec > 0) {
|
||||||
await this._waitForInterval(task.hoster, settings.timeIntervalSec * 1000, signal);
|
await this._waitForInterval(task.hoster, settings.timeIntervalSec * 1000, signal);
|
||||||
}
|
}
|
||||||
@ -438,8 +440,9 @@ class UploadManager extends EventEmitter {
|
|||||||
this.activeJobs.delete(uploadId);
|
this.activeJobs.delete(uploadId);
|
||||||
this.jobAbortControllers.delete(jobId);
|
this.jobAbortControllers.delete(jobId);
|
||||||
cleanupSignals();
|
cleanupSignals();
|
||||||
if (hosterSlotAcquired) hosterSemaphore.release();
|
// Release in reverse order of acquire (global first, then hoster)
|
||||||
if (globalSlotAcquired && globalSemaphore) globalSemaphore.release();
|
if (globalSlotAcquired && globalSemaphore) globalSemaphore.release();
|
||||||
|
if (hosterSlotAcquired) hosterSemaphore.release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-hoster-uploader",
|
"name": "multi-hoster-uploader",
|
||||||
"version": "1.8.0",
|
"version": "1.8.1",
|
||||||
"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": {
|
||||||
|
|||||||
@ -1465,7 +1465,8 @@ function updateStatusBar() {
|
|||||||
|
|
||||||
document.getElementById('sbState').textContent = stateText;
|
document.getElementById('sbState').textContent = stateText;
|
||||||
document.getElementById('sbSpeed').textContent = formatSpeed(lastUploadStats.globalSpeedKbs || 0);
|
document.getElementById('sbSpeed').textContent = formatSpeed(lastUploadStats.globalSpeedKbs || 0);
|
||||||
document.getElementById('sbTotal').textContent = formatSize(lastUploadStats.totalBytes || 0);
|
const queueTotalBytes = queueJobs.reduce((sum, j) => sum + (j.bytesTotal || 0), 0);
|
||||||
|
document.getElementById('sbTotal').textContent = `${formatSize(lastUploadStats.totalBytes || 0)} / ${formatSize(queueTotalBytes)}`;
|
||||||
document.getElementById('sbEta').textContent = `ETA ${etaSeconds > 0 ? formatTime(etaSeconds) : '--:--'}`;
|
document.getElementById('sbEta').textContent = `ETA ${etaSeconds > 0 ? formatTime(etaSeconds) : '--:--'}`;
|
||||||
document.getElementById('sbConnections').textContent = `Aktive Verbindungen ${lastUploadStats.activeJobs || 0}`;
|
document.getElementById('sbConnections').textContent = `Aktive Verbindungen ${lastUploadStats.activeJobs || 0}`;
|
||||||
document.getElementById('sbQueueCount').textContent = `Gesamt ${counts.total}`;
|
document.getElementById('sbQueueCount').textContent = `Gesamt ${counts.total}`;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user