Commits

Adam Kocoloski  committed d68779f

_externals should respect os_process_timeout setting

  • Participants
  • Parent commits 92e206a

Comments (0)

Files changed (1)

File src/couchdb/couch_external_server.erl

 init([Name, Command]) ->
     ?LOG_INFO("EXTERNAL: Starting process for: ~s", [Name]),
     ?LOG_INFO("COMMAND: ~s", [Command]),
-    {ok, Pid} = couch_os_process:start_link(Command),
+    Timeout = list_to_integer(couch_config:get("couchdb", "os_process_timeout",
+        "5000")),
+    {ok, Pid} = couch_os_process:start_link(Command, [{timeout, Timeout}]),
+    couch_config:register(fun("couchdb", "os_process_timeout", NewTimeout) ->
+        couch_os_process:set_timeout(Pid, list_to_integer(NewTimeout))
+    end),
     {ok, {Name, Command, Pid}}.
 
 terminate(_Reason, {_Name, _Command, Pid}) ->