@torrent-tv/proxy 2.6.6 → 2.8.0

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torrent-tv/proxy",
3
- "version": "2.6.6",
3
+ "version": "2.8.0",
4
4
  "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "publishConfig": {
@@ -18,13 +18,17 @@ import { logger } from "../utils/logger.js";
18
18
 
19
19
  const PLAYLIST_FILE_NAME = "index.m3u8";
20
20
  const SEGMENT_FILE_NAME_PATTERN = /^segment-\d{5}\.ts$/;
21
- const CLEANUP_INTERVAL_MS = 60_000;
21
+ const CLEANUP_INTERVAL_MS = 30_000;
22
22
  const DEFAULT_SEGMENT_DURATION_SEC = 4;
23
23
  // How many segments ahead of the current encode head a missing-segment request
24
24
  // is allowed to be before we restart ffmpeg at that position (server-side seek).
25
25
  // Requests within the window are served by waiting for the running encode.
26
26
  const MAX_LOOKAHEAD_SEGMENTS = 8;
27
- const DEFAULT_SESSION_TTL_MS = 30 * 60 * 1000;
27
+ // Idle TTL: a session is disposed this long after the last segment/playlist
28
+ // access. Kept short so an ffmpeg process does not keep burning CPU after the
29
+ // viewer stops or navigates away. Active playback refreshes the timer on every
30
+ // segment fetch, so it never expires mid-watch.
31
+ const DEFAULT_SESSION_TTL_MS = 120 * 1000;
28
32
  const DEFAULT_STARTUP_WAIT_MS = 5_000;
29
33
  const MICROSECONDS_PER_SECOND = 1_000_000;
30
34
  const PROGRESS_LOG_INTERVAL_MS = 5_000;