chiark / gitweb /
wdt: Fix load race
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 Apr 2021 11:11:53 +0000 (12:11 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 Apr 2021 18:17:06 +0000 (19:17 +0100)
With the sleep this fails before, and passes afterwards.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
daemon/session.rs
templates/script.ts

index 8ddda535a95762cf2f05c7757673e84b4e7053a0..0229793fc7b9f61565ac8e63809effe7a20f9683 100644 (file)
@@ -86,6 +86,7 @@ impl SvgAttrs {
 fn session_inner(form: Json<SessionForm>,
                  layout: Option<PresentationLayout>)
                  -> Result<Template,OE> {
+  sleep(Duration::from_secs(2));
   // make session in this game, log a message to other players
   let iad = lookup_token(form.ptoken.borrow())?;
   let player = iad.ident;
index 3dd0cb5455f99a8c646f0635b3dcafe9b10d1ea0..b32b36f752c2ec82646c3b376a76c1d1b5969f62 100644 (file)
@@ -1548,6 +1548,7 @@ function startup() {
   }
 
   if (gen_update_hook == null) gen_update_hook = function() { };
+  gen_update_hook();
 
   last_log_ts = wasm_bindgen.timestamp_abbreviator(dataload.last_log_ts);