From: Stefano Zacchiroli Date: Tue, 5 Dec 2006 13:30:22 +0000 (+0000) Subject: do not share the db connection among children, should fix the "server has gone away... X-Git-Tag: 0.4.95@7852~751 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=e98e464e933174ad6577596d32cba1de758ea919;p=helm.git do not share the db connection among children, should fix the "server has gone away" error --- diff --git a/daemons/whelp/searchEngine.ml b/daemons/whelp/searchEngine.ml index 8524588ca..924f69a76 100644 --- a/daemons/whelp/searchEngine.ml +++ b/daemons/whelp/searchEngine.ml @@ -260,6 +260,7 @@ let send_results results moogle_TPL let exec_action dbd (req: Http_types.request) outchan = + let dbd = dbd () in let term_str = req#param "expression" in try if req#path = "/elim" && @@ -449,7 +450,7 @@ let callback dbd (req: Http_types.request) outchan = if expression = "" then send_results (`Results []) req outchan else begin - let results = Whelp.locate ~dbd expression in + let results = Whelp.locate ~dbd:(dbd ()) expression in let results = List.map UriManager.string_of_uri results in send_results (`Results results) req outchan end @@ -505,7 +506,7 @@ let _ = printf "HTML directory is %s\n" pages_dir; flush stdout; Unix.putenv "http_proxy" ""; - let dbd = + let dbd () = HMysql.quick_connect ~host:(Helm_registry.get "db.host") ~database:(Helm_registry.get "db.database")