| [] -> uris
| l -> let uris, next = close_uri_list l in fix uris next @ uris
+let cleaned_no = ref 0;;
+
let clean_baseuris ?(verbose=true) buris =
Hashtbl.clear cache_of_processed_baseuri;
let buris = List.map HGM.strip_trailing_slash buris in
debug_prerr "clean_baseuri will remove:";
if debug then
List.iter (fun u -> debug_prerr (UriManager.string_of_uri u)) l;
- List.iter (MatitaSync.remove ~verbose) l
+ 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()]
let is_empty buri = HG.ls (HGM.strip_trailing_slash buri ^ "/") = []