uris map
;;
+exception PerlGetterNotResponding;;
+
let update () =
let module C = Configuration in
let fd = open_in C.servers_file in
Dbm.opendbm C.uris_dbm [Dbm.Dbm_wronly ; Dbm.Dbm_create] 0o660
in
MapOfStrings.iter (fun uri url -> Dbm.add dbm uri url) urls_of_uris ;
- Dbm.close dbm
+ Dbm.close dbm ;
+ (* Inform also the Perl-getter *)
+ if Sys.command ("wget -O /dev/null http://localhost:8081/update") <> 0
+ then
+ raise PerlGetterNotResponding ;
;;
(* url_of_uri : uri -> url *)
let module U = UriManager in
get_file
(U.uri_of_string
- (Str.replace_first (Str.regexp "\.ann$") ""
- (Str.replace_first (Str.regexp "\.types$") "" (U.string_of_uri uri))))
+ (Str.replace_first (Str.regexp "\.types$") ""
+ (Str.replace_first (Str.regexp "\.ann$") "" (U.string_of_uri uri))))
;;
(* get_ann : uri -> filename *)