summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_external_server.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/couchdb/couch_external_server.erl b/src/couchdb/couch_external_server.erl
index 7e81cae1..8e632510 100644
--- a/src/couchdb/couch_external_server.erl
+++ b/src/couchdb/couch_external_server.erl
@@ -34,7 +34,12 @@ execute(Pid, JsonReq) ->
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}) ->