mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-21 23:50:45 +00:00
Pause and resume now go through one process-level control plane that survives panel/terminal close: TransferRuntime + soft latches/epochs/walk registry, soft-then-hard resume, dual-epoch-safe progress, and no-owner soft control.
25 lines
965 B
TypeScript
25 lines
965 B
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import {
|
|
DEFAULT_SFTP_TRANSFER_POOL_IDLE_TTL_MS,
|
|
isTransferPoolIdleReclaimDisabled,
|
|
resolveSftpTransferPoolIdleTtlMs,
|
|
} from "../../../infrastructure/config/sftpTransferPool";
|
|
|
|
test("default pool idle TTL is five minutes", () => {
|
|
assert.equal(DEFAULT_SFTP_TRANSFER_POOL_IDLE_TTL_MS, 5 * 60_000);
|
|
assert.equal(resolveSftpTransferPoolIdleTtlMs(() => null), DEFAULT_SFTP_TRANSFER_POOL_IDLE_TTL_MS);
|
|
});
|
|
|
|
test("accepts preset values including never-reclaim zero", () => {
|
|
assert.equal(resolveSftpTransferPoolIdleTtlMs(() => 60_000), 60_000);
|
|
assert.equal(resolveSftpTransferPoolIdleTtlMs(() => 0), 0);
|
|
assert.equal(resolveSftpTransferPoolIdleTtlMs(() => 123), DEFAULT_SFTP_TRANSFER_POOL_IDLE_TTL_MS);
|
|
});
|
|
|
|
test("zero disables idle reclaim", () => {
|
|
assert.equal(isTransferPoolIdleReclaimDisabled(0), true);
|
|
assert.equal(isTransferPoolIdleReclaimDisabled(300_000), false);
|
|
});
|