diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2009-09-22 18:16:50 +0000 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2009-09-22 18:16:50 +0000 |
commit | dd954c5d0950476532d63b6c05435018de388b87 (patch) | |
tree | 4e1cc6e0956c99a000fc12c858deb1ca4d194056 /src/couchdb/couch_external_server.erl | |
parent | 688cf651f9b7867bd54e80ac978c8827eea698b9 (diff) |
_externals should respect os_process_timeout setting
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@817749 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_external_server.erl')
-rw-r--r-- | src/couchdb/couch_external_server.erl | 7 |
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}) -> |