@torrent-tv/proxy 2.101.22 → 2.101.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -219,7 +219,7 @@ export class OutputLifecycle {
|
|
|
219
219
|
const maxBytes = this.#host.machineBudget.segmentBytes();
|
|
220
220
|
const inventory = this.#host.segmentStore.inventory();
|
|
221
221
|
let held = inventory.reduce((bytes, output) => bytes + output.bytes, 0);
|
|
222
|
-
if (!Number.isFinite(maxBytes) || maxBytes
|
|
222
|
+
if (!Number.isFinite(maxBytes) || maxBytes < 0 || held <= maxBytes) return;
|
|
223
223
|
const candidates = leastNeededSegments(inventory.map(output => ({
|
|
224
224
|
...output,
|
|
225
225
|
positions: this.#host.viewerSegmentsOn(output.key),
|
package/services/storage/wire.js
CHANGED
|
@@ -56,9 +56,9 @@ import { availableMemoryBytes } from "./machine-memory.js";
|
|
|
56
56
|
* @param {import("./MachineBudget.js").BudgetPolicy} [params.policy] - What the
|
|
57
57
|
* operator has said this proxy may take. Absent, the measured default.
|
|
58
58
|
* @param {{ info: Function, warn?: Function }} [params.logger]
|
|
59
|
-
* @returns {{ revise: () => Promise<unknown>, segmentBytes: () => number, diagnostics: object | null, describe: () => string }}
|
|
60
|
-
* What the segments may hold is asked for rather than pushed:
|
|
61
|
-
* first revision,
|
|
59
|
+
* @returns {{ revise: () => Promise<unknown>, segmentBytes: () => number | null, diagnostics: object | null, describe: () => string }}
|
|
60
|
+
* What the segments may hold is asked for rather than pushed: null until the
|
|
61
|
+
* first revision, then the measured allowance, including a measured zero.
|
|
62
62
|
*/
|
|
63
63
|
export function wireMachineBudget({
|
|
64
64
|
segmentStore,
|
|
@@ -101,7 +101,7 @@ export function wireMachineBudget({
|
|
|
101
101
|
const segmentsOn = deviceOf(segmentStore.root);
|
|
102
102
|
defineDisk(segmentsOn, segmentStore.root);
|
|
103
103
|
|
|
104
|
-
let segmentBytes =
|
|
104
|
+
let segmentBytes = null;
|
|
105
105
|
budget.register({
|
|
106
106
|
name: "segments",
|
|
107
107
|
resource: segmentsOn,
|