let dbd = instance () in
let suri = UriManager.string_of_uri uri in
let query table suri = sprintf
- "DELETE FROM %s WHERE source LIKE '%s%%'" table (HMysql.escape suri)
+ "DELETE QUICK LOW_PRIORITY FROM %s WHERE source='%s'" table (HMysql.escape suri)
in
List.iter (fun t ->
try
exn -> raise exn (* no errors should be accepted *)
)
[obj_tbl;sort_tbl;rel_tbl;name_tbl;(*conclno_tbl;conclno_hyp_tbl*)count_tbl];
- (* and now the debug job *)
- let dbg_q =
- sprintf "SELECT source FROM %s WHERE h_occurrence LIKE '%s%%'" obj_tbl
- (HMysql.escape suri)
- in
- try
- let rc = HMysql.exec dbd dbg_q in
- let l = ref [] in
- HMysql.iter rc (fun a -> match a.(0) with None ->()|Some a -> l := a:: !l);
- let l = List.sort Pervasives.compare !l in
- HExtlib.list_uniq l
- with
- exn -> raise exn (* no errors should be accepted *)
+;;
let xpointers_of_ind uri =
let dbd = instance () in
val create_owner_environment: unit -> unit
val clean_owner_environment: unit -> unit
-(* returns a list of uri thet must be removed sice they reference uri,
- * but this is used only for debugging purposes *)
-val remove_uri: UriManager.uri -> string list
+val remove_uri: UriManager.uri -> unit
val xpointers_of_ind: UriManager.uri -> UriManager.uri list
let innertypesuri, bodyuri, univgraphuri = uris_of_obj uri in
innertypesuri::univgraphuri::(match bodyuri with None -> [] | Some u -> [u])
in
- let to_remove =
- uri ::
- (if UriManager.uri_is_ind uri then LibraryDb.xpointers_of_ind uri else []) @
- derived_uris_of_uri uri
- in
+ let uris_to_remove =
+ if UriManager.uri_is_ind uri then LibraryDb.xpointers_of_ind uri else [uri]
+ in
+ let files_to_remove = uri :: derived_uris_of_uri uri in
+ List.iter
+ (fun uri ->
+ (try
+ let file = Http_getter.resolve' ~writable:true uri in
+ HExtlib.safe_remove file;
+ HExtlib.rmdir_descend (Filename.dirname file)
+ with Http_getter_types.Key_not_found _ -> ());
+ ) files_to_remove ;
List.iter
- (fun uri ->
- (try
- let file = Http_getter.resolve' ~writable:true uri in
- HExtlib.safe_remove file;
- HExtlib.rmdir_descend (Filename.dirname file)
- with Http_getter_types.Key_not_found _ -> ());
- ignore (LibraryDb.remove_uri uri);
- (*CoercGraph.remove_coercion uri;*)
- CicEnvironment.remove_obj uri)
- to_remove
+ (fun uri ->
+ ignore (LibraryDb.remove_uri uri);
+ (*CoercGraph.remove_coercion uri;*)
+ CicEnvironment.remove_obj uri
+ ) uris_to_remove
(*** GENERATION OF AUXILIARY LEMMAS ***)