From: Ian Jackson Date: Sun, 4 Apr 2021 11:11:53 +0000 (+0100) Subject: wdt: Fix load race X-Git-Tag: otter-0.5.0~243 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3ec9fbdb6fa4fab5299457b687564551f879634e;p=otter.git wdt: Fix load race With the sleep this fails before, and passes afterwards. Signed-off-by: Ian Jackson --- diff --git a/daemon/session.rs b/daemon/session.rs index 8ddda535..0229793f 100644 --- a/daemon/session.rs +++ b/daemon/session.rs @@ -86,6 +86,7 @@ impl SvgAttrs { fn session_inner(form: Json, layout: Option) -> Result { + 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; diff --git a/templates/script.ts b/templates/script.ts index 3dd0cb54..b32b36f7 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -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);