Skip to content

Commit

Permalink
lll
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMcInnes committed Dec 19, 2024
1 parent b7ac5e9 commit 6df628a
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/patches/index.html.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- index.html 2024-12-17 17:13:52.442569994 +1000
+++ venus-gui-v2.html 2024-12-17 17:08:58.496874189 +1000
--- venus-gui-v2.html 2024-12-19 11:52:03.677046276 +1000
+++ index.html 2024-12-19 11:52:08.032989437 +1000
@@ -12,15 +12,18 @@
<title>venus-gui-v2</title>
<style>
Expand Down Expand Up @@ -62,19 +62,33 @@
qt: {
onLoaded: () => showUi(screen),
onExit: exitData =>
@@ -70,5 +99,15 @@
@@ -70,5 +99,29 @@
</script>
<script src="venus-gui-v2.js"></script>
<script type="text/javascript" src="qtloader.js"></script>
+ <script type="text/javascript">
+ var watchdogHit = false // this gets set to 'true' by a timer in BackendConnection::onWatchdogTimerExpired()
+ setInterval(function() {
+ const longTimeout = 120000 // 2 minutes - allow plenty of time for the browser to load the wasm
+ const shortTimeout = 20000 // 20 seconds - use this timeout once the page has loaded
+ let interval = longTimeout
+ console.log("starting watchdog timer")
+ var timer = setInterval(checkWatchdog, interval)
+
+ function checkWatchdog()
+ {
+ if (!watchdogHit) {
+ console.error("Watchdog timer expired - reloading page")
+ location.reload()
+ } else {
+ if (interval == longTimeout) {
+ interval = shortTimeout
+ console.log("changing timeout to", interval)
+ clearInterval(timer)
+ timer = setInterval(checkWatchdog, interval)
+ }
+ }
+ watchdogHit = false
+ }, 20000);
+ }
+ </script>
</body>
</html>

0 comments on commit 6df628a

Please sign in to comment.