From ea8527eea59f98adca60b75ffea529a2273b78ef Mon Sep 17 00:00:00 2001 From: capellancitizen Date: Wed, 19 Jun 2024 10:43:07 -0400 Subject: PDF Preview webpage now pings in worker (#2993) (#2996) * PDF Preview webpage now pings in worker (#2993) Avoids a timeout that can happen if rendering the page takes too long --- print/resources/pingworker.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 print/resources/pingworker.js (limited to 'print/resources/pingworker.js') diff --git a/print/resources/pingworker.js b/print/resources/pingworker.js new file mode 100644 index 00000000..ac4e81a9 --- /dev/null +++ b/print/resources/pingworker.js @@ -0,0 +1,9 @@ +function ping() { + fetch("/ping") + .then(() => setTimeout(ping, 1000)) + .catch((e) => { + console.error(e); + postMessage("error"); + }) +} +setTimeout(ping, 1000); \ No newline at end of file -- cgit v1.2.3