Fix pause showing Provider-Cooldown, lower extraction I/O priority

- Add pause check at top of processItem retry loop so items show
  "Pausiert" instead of "Provider-Cooldown" when paused
- Lower extraction process priority from BELOW_NORMAL to IDLE
  (IDLE_PRIORITY_CLASS on Windows also lowers I/O priority, reducing
  disk contention between extraction and active downloads)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sucukdeluxe 2026-03-02 21:06:00 +01:00
parent e90e731eaa
commit 55e5b0079a
3 changed files with 15 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "real-debrid-downloader",
"version": "1.5.19",
"version": "1.5.20",
"description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)",
"main": "build/main/main/main.js",
"author": "Sucukdeluxe",

View File

@ -3510,6 +3510,17 @@ export class DownloadManager extends EventEmitter {
const maxStallRetries = maxItemRetries;
while (true) {
try {
// Wait while paused — don't check cooldown or unrestrict while paused
while (this.session.paused && this.session.running && !active.abortController.signal.aborted) {
item.status = "paused";
item.fullStatus = "Pausiert";
item.speedBps = 0;
this.emitState();
await sleep(120);
}
if (active.abortController.signal.aborted) {
throw new Error(`aborted:${active.abortReason}`);
}
// Check provider cooldown before attempting unrestrict
const lastProvider = item.provider || "";
const cooldownProvider = lastProvider || this.settings.providerPrimary || "unknown";

View File

@ -445,7 +445,9 @@ function lowerExtractProcessPriority(childPid: number | undefined): void {
return;
}
try {
os.setPriority(pid, os.constants.priority.PRIORITY_BELOW_NORMAL);
// PRIORITY_LOW = IDLE_PRIORITY_CLASS on Windows, which also lowers I/O priority
// so extraction doesn't starve downloads or UI from disk bandwidth
os.setPriority(pid, os.constants.priority.PRIORITY_LOW);
} catch {
// ignore: priority lowering is best-effort
}