Added delay to watcher

This commit is contained in:
Fabio Salvini 2017-06-11 23:06:10 +02:00
parent 5c920823bb
commit 2f74f322ef
1 changed files with 1 additions and 0 deletions

View File

@ -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]}.