~proc_get_jobs
~proc_cancel_job
~proc_start_job
+ ~proc_get_job
(Rpc_server.Unix addr)
Rpc.Tcp (* not TCP, this is the same as SOCK_STREAM *)
Rpc.Socket
state := Whenstate.set_variable !state name value;
(* Which jobs need to be re-evaluated? *)
- let jobs = Whenstate.get_dependencies !state name in
+ let jobs = Whenstate.get_dependencies !state [name] in
reevaluate_whenjobs jobs;
`ok
| Not_found -> `error "job not found"
| exn -> `error (Printexc.to_string exn)
+and proc_get_job serial =
+ try
+ let serial = big_int_of_string serial in
+ let pid = BigIntMap.find serial !serialmap in
+ let job, dir, serial, start_time = IntMap.find pid !runningmap in
+ { Whenproto_aux.job_name = job.job_name;
+ job_serial = string_of_big_int serial;
+ job_tmpdir = dir; job_start_time = Int64.of_float start_time }
+ with
+ | Not_found -> failwith "job not found"
+ | exn -> failwith (Printexc.to_string exn)
+
(* Reload the jobs file. *)
and reload_file () =
let file = sprintf "%s/jobs.cmo" !jobsdir in
| exn ->
failwith (Printexc.to_string exn) in
+ let s = Whenstate.copy_prev_state !state s in
state := s;
(* Re-evaluate all when jobs. *)