X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2FmatitacleanLib.ml;h=51268acef0c8084216a7107346308b23813f3416;hb=3147daf418c31528a67462c77b4cb3fd6431289c;hp=3a1d2e3db5068f3af2cd02819dbcbd692827901e;hpb=6d9f41964a95bc6fe6d9e7d47331ac7f8574fd17;p=helm.git diff --git a/helm/matita/matitacleanLib.ml b/helm/matita/matitacleanLib.ml index 3a1d2e3db..51268acef 100644 --- a/helm/matita/matitacleanLib.ml +++ b/helm/matita/matitacleanLib.ml @@ -47,15 +47,15 @@ let one_step_depend suri = Hashtbl.add cache_of_processed_baseuri buri true; let query = let buri = buri ^ "/" in - let buri = Mysql.escape buri in + let buri = HMysql.escape buri in let obj_tbl = MetadataTypes.obj_tbl () in Printf.sprintf "SELECT source, h_occurrence FROM %s WHERE h_occurrence LIKE '%s%%'" obj_tbl buri in try - let rc = Mysql.exec (MatitaDb.instance ()) query in + let rc = HMysql.exec (MatitaDb.instance ()) query in let l = ref [] in - Mysql.iter rc ( + HMysql.iter rc ( fun row -> match row.(0), row.(1) with | Some uri, Some occ when Filename.dirname occ = buri -> @@ -143,14 +143,17 @@ let clean_baseuris ?(verbose=true) buris = List.iter (fun u -> debug_prerr (UriManager.string_of_uri u)) l; Hashtbl.iter (fun buri _ -> - MatitaMisc.safe_remove (MatitaMisc.obj_file_of_baseuri buri) - ) cache_of_processed_baseuri; + MatitaMisc.safe_remove (MatitaMisc.obj_file_of_baseuri buri)) + cache_of_processed_baseuri; List.iter (MatitaSync.remove ~verbose) l; cleaned_no := !cleaned_no + List.length l; if !cleaned_no > 30 then - List.iter - (function table -> - ignore (Mysql.exec (MatitaDb.instance ()) ("OPTIMIZE TABLE " ^ table))) - [MetadataTypes.name_tbl (); MetadataTypes.rel_tbl (); - MetadataTypes.sort_tbl (); MetadataTypes.obj_tbl(); - MetadataTypes.count_tbl()] + begin + cleaned_no := 0; + List.iter + (function table -> + ignore (HMysql.exec (MatitaDb.instance ()) ("OPTIMIZE TABLE " ^ table))) + [MetadataTypes.name_tbl (); MetadataTypes.rel_tbl (); + MetadataTypes.sort_tbl (); MetadataTypes.obj_tbl(); + MetadataTypes.count_tbl()] + end