]> matita.cs.unibo.it Git - helm.git/commitdiff
Added the lines required to initialize and close the connection to the
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 2 Apr 2003 11:00:58 +0000 (11:00 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 2 Apr 2003 11:00:58 +0000 (11:00 +0000)
database.

helm/hbugs/tutors/search_pattern_apply_tutor.ml

index 531e94e0eae552df99896c198d1c62346740ce3a..829d86f74755f35b861969933653431a471aeef6 100644 (file)
@@ -79,6 +79,13 @@ let callback (req: Http_types.request) outchan =
         (Exception ("parse_error", reason)))
       outchan
 
+let postgresqlconnectionstring =
+ try
+  Sys.getenv "POSTGRESQL_CONNECTION_STRING"
+ with
+  Not_found -> "host=mowgli.cs.unibo.it dbname=helm_mowgli_new_schema user=helm"
+;;
+
 let main () =
   try
     Sys.catch_break true;
@@ -86,8 +93,11 @@ let main () =
     broker_id :=
       Some (Hbugs_tutors_common.register_to_broker
         my_own_id my_own_url "FOO" "Search_pattern_apply tutor");
+    Mqint.set_database Mqint.postgres_db ;
+    Mqint.init postgresqlconnectionstring ;
     Http_daemon.start'
-      ~addr:my_own_addr ~port:my_own_port ~mode:`Thread callback
+      ~addr:my_own_addr ~port:my_own_port ~mode:`Thread callback;
+    Mqint.close ()
   with Sys.Break -> ()  (* exit nicely, invoking at_exit functions *)
 ;;