From fb772e4fce9e5d8dc1a71793a49c18de2dfc1f13 Mon Sep 17 00:00:00 2001 From: Dave Aitken Date: Tue, 17 Apr 2018 11:53:13 +0100 Subject: [PATCH] Reload on first connection --- src/livereload.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/livereload.ml b/src/livereload.ml index c04d861..6e154e4 100644 --- a/src/livereload.ml +++ b/src/livereload.ml @@ -103,5 +103,10 @@ let make_handler (next : handler) : handler = let send_update_fn, handler = make_raw_handler ~debug next in - Lwt.async (fun _ -> Backend.make_watcher ~debug path_configs send_update_fn); + Lwt.async (fun () -> Backend.make_watcher ~debug path_configs send_update_fn); + Lwt.async (fun () -> + Lwt_unix.sleep 1.0 >>= fun _ -> + send_update_fn "/" + ); handler +