@muhkoo/theater-transcoder 0.2.1 → 0.2.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/worker.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muhkoo/theater-transcoder",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Drain a Muhkoo Theater transcode queue with NATIVE ffmpeg. Run it on any machine signed in as you to add transcoding power to your library.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/worker.js CHANGED
@@ -13,7 +13,7 @@ const WORKER_LABEL = `the transcoder (${hostname()})`;
13
13
  // Capability score: native ffmpeg on many cores far outranks a browser's wasm
14
14
  // (cores×~30), so browsers defer manifest-ready jobs to this machine.
15
15
  const MY_SCORE = cpus().length * 30;
16
- const STALE_MS = 90_000;
16
+ const STALE_MS = 45_000;
17
17
  const POLL_MS = 4_000;
18
18
 
19
19
  const log = (...a) => console.log(new Date().toISOString().slice(11, 19), ...a);
@@ -109,7 +109,7 @@ export function startWorker({ client, space, appKey, baseUrl }) {
109
109
  (async () => {
110
110
  log(`worker ${WORKER_ID} draining queue as ${client.auth.zk.user.username} (${WORKER_LABEL}, score ${MY_SCORE})`);
111
111
  // Announce capability so browsers defer manifest-ready jobs to us.
112
- const hello = () => void postSignal({ kind: "hello", score: MY_SCORE, worker: WORKER_LABEL });
112
+ const hello = () => void postSignal({ kind: "hello", score: MY_SCORE, worker: WORKER_LABEL, native: true });
113
113
  hello(); setInterval(hello, 4_000);
114
114
  // Real-time wake on new jobs; also re-announce presence right away so the
115
115
  // uploader learns a strong worker is here and defers to us. Poll is fallback.