diff options
author | metamuffin <metamuffin@disroot.org> | 2025-05-18 15:11:00 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-05-18 15:11:00 +0200 |
commit | 441142f26921510a049d6a8458026c7c6d962ca1 (patch) | |
tree | 39d19bbb3b4801ba3b47bcde0d0572007faedcd7 /scripts | |
parent | f59dcc4a77412750f8dde72ed335a8262206ef5d (diff) | |
download | isda-441142f26921510a049d6a8458026c7c6d962ca1.tar isda-441142f26921510a049d6a8458026c7c6d962ca1.tar.bz2 isda-441142f26921510a049d6a8458026c7c6d962ca1.tar.zst |
fix a few live updating bugs
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/dummy_worker.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/dummy_worker.ts b/scripts/dummy_worker.ts index 00e6ad2..1bbe0c7 100644 --- a/scripts/dummy_worker.ts +++ b/scripts/dummy_worker.ts @@ -4,7 +4,7 @@ const ws = new WebSocket(Deno.args[0]) async function do_work(key: string) { let progress = 0 while (progress < 1) { - await new Promise(r => setTimeout(r, 200)) + await new Promise(r => setTimeout(r, Math.random() * 400)) progress += 0.1 ws.send(JSON.stringify({ t: "metadata", key, data: { progress } })) } @@ -17,6 +17,7 @@ ws.onopen = () => { console.log("ws open"); ws.send(JSON.stringify({ t: "register", name: "dummy worker", task_kinds: ["youtube"] })) ws.send(JSON.stringify({ t: "accept" })) + ws.send(JSON.stringify({ t: "accept" })) } ws.onmessage = async ev => { if (typeof ev.data != "string") return |