Fix AllDebrid start reservation pacing
This commit is contained in:
parent
9d6e1ad795
commit
066ef14806
@ -5561,13 +5561,14 @@ export class DownloadManager extends EventEmitter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const activeCount = this.getProviderActiveTaskCount("alldebrid");
|
if (this.getProviderActiveTaskCount("alldebrid") <= 0) {
|
||||||
if (activeCount <= 0) {
|
|
||||||
this.providerStartReservations.delete(paceKey);
|
this.providerStartReservations.delete(paceKey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.providerStartReservations.set(paceKey, now + activeCount * ALLDEBRID_START_STAGGER_MS);
|
const existingReservation = this.providerStartReservations.get(paceKey) || 0;
|
||||||
|
const baseReservation = Math.max(now, existingReservation);
|
||||||
|
this.providerStartReservations.set(paceKey, baseReservation + ALLDEBRID_START_STAGGER_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
private getConfiguredAllDebridStartLimit(): number {
|
private getConfiguredAllDebridStartLimit(): number {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user