val is_in_unchecked: UriManager.uri -> bool
val is_in_cooked: UriManager.uri -> bool
val list_all_cooked_uris: unit -> UriManager.uri list
+ val invalidate: unit -> unit
end
=
struct
(* unchecked is used to store objects just fetched, nothing more. *)
let unchecked_list = ref [];;
+ let invalidate _ =
+ let l = HT.fold (fun k (o,g,gl) acc -> (k,(o,Some (g,gl)))::acc) cacheOfCookedObjects [] in
+ unchecked_list := l ;
+ frozen_list := [];
+ HT.clear cacheOfCookedObjects;
+ ;;
+
let empty () =
HT.clear cacheOfCookedObjects;
unchecked_list := [] ;
match UriManager.bodyuri_of_uri uri with
None -> None
| Some bodyuri ->
- if Http_getter.exists' bodyuri then
+ if Http_getter.exists' ~local:false bodyuri then
Some (Http_getter.getxml' bodyuri)
else
None
let add_type_checked_obj uri (obj,ugraph,univlist) =
Cache.add_cooked ~key:uri (obj,ugraph,univlist)
-let in_library uri = in_cache uri || Http_getter.exists' uri
+let in_library uri = in_cache uri || Http_getter.exists' ~local:false uri
let remove_obj = Cache.remove
debug_print (lazy "Who has removed the uri in the meanwhile?");
raise Not_found
;;
+
+let invalidate _ =
+ Cache.invalidate ()
+;;