From 2f74f322ef759a2fe380cb469aa2a8e69e0ca8ec Mon Sep 17 00:00:00 2001 From: Fabio Salvini Date: Sun, 11 Jun 2017 23:06:10 +0200 Subject: [PATCH] Added delay to watcher --- apps/log_monitor/src/watcher.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/log_monitor/src/watcher.erl b/apps/log_monitor/src/watcher.erl index f80ed90..8496373 100644 --- a/apps/log_monitor/src/watcher.erl +++ b/apps/log_monitor/src/watcher.erl @@ -6,6 +6,7 @@ start_link(SupPid, File) -> gen_server:start_link(?MODULE, [SupPid, File], []). init([SupPid, File]) -> + timer:sleep(1000), Cmd = "/usr/bin/tail -n0 --follow=name " ++ File, Port = open_port({spawn, Cmd}, [stderr_to_stdout, exit_status, binary]), {ok, [SupPid, Port]}.