#SED=sed "s/font-family:Times;//g"
SED=cat
-REQUIRES = http
+REQUIRES = http helm-registry
PREDICATES = mt
OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -thread
OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS)
open Printf;;
+let configuration_file = "/projects/helm/etc/uriSetQueue.conf.xml";;
let daemon_name = "Uri Set Queue";;
-let default_port = 48082;;
-let port_env_var = "URI_SET_QUEUE_PORT";;
module OrderedUri: Set.OrderedType with type t = string =
struct
with Found -> true
;;
-let port =
- try
- int_of_string (Sys.getenv port_env_var)
- with
- | Not_found -> default_port
- | Failure "int_of_string" ->
- prerr_endline "Warning: invalid port, reverting to default";
- default_port
-in
let callback (req: Http_types.request) outchan =
try
let res = new Http_response.response () in
outchan
in
+Helm_registry.load_from configuration_file;
+let port = Helm_registry.get_int "uri_set_queue.port" in
printf "%s started and listening on port %d\n" daemon_name port;
flush stdout;
Http_daemon.start' ~port ~mode:`Thread callback;