Scripts updated to use new PG interface.
[cocanwiki.git] / scripts / mail_rebuild.ml
index cb5ba0e..a16314a 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: mail_rebuild.ml,v 1.1 2004/10/21 11:42:04 rich Exp $
+ * $Id: mail_rebuild.ml,v 1.4 2006/03/28 16:24:07 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -28,18 +28,18 @@ open Cocanwiki
 open Cocanwiki_ok
 open Cocanwiki_mail
 
-let run r (q : cgi) (dbh : Dbi.connection) hostid _ user =
+let run r (q : cgi) dbh hostid _ user =
   let year = int_of_string (q#param "year") in
   let month = int_of_string (q#param "month") in
 
   thread_mail dbh hostid ~user ~r year month;
 
   (* Commit to the database. *)
-  dbh#commit ();
+  PGOCaml.commit dbh;
 
   (* Finish off. *)
   ok ~title:"Rebuilt"
-    q ("Thread index rebuilt.")
+    dbh hostid q "Thread index rebuilt."
 
 let () =
   register_script ~restrict:[CanImportMail] run