couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r817749 - /couchdb/trunk/src/couchdb/couch_external_server.erl
Date Tue, 22 Sep 2009 18:16:51 GMT
Author: kocolosk
Date: Tue Sep 22 18:16:50 2009
New Revision: 817749

URL: http://svn.apache.org/viewvc?rev=817749&view=rev
Log:
_externals should respect os_process_timeout setting

Modified:
    couchdb/trunk/src/couchdb/couch_external_server.erl

Modified: couchdb/trunk/src/couchdb/couch_external_server.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_external_server.erl?rev=817749&r1=817748&r2=817749&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_external_server.erl (original)
+++ couchdb/trunk/src/couchdb/couch_external_server.erl Tue Sep 22 18:16:50 2009
@@ -34,7 +34,12 @@
 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}) ->



Mime
View raw message