remarks from running
This commit is contained in:
parent
fc4afd870f
commit
8a342e4ddb
|
@ -185,6 +185,7 @@ let job_finished state uuid res data =
|
||||||
ignore (Bos.OS.File.write p value))
|
ignore (Bos.OS.File.write p value))
|
||||||
data;
|
data;
|
||||||
let in_dir = Fpath.(out_dir / "input") in
|
let in_dir = Fpath.(out_dir / "input") in
|
||||||
|
ignore (Bos.OS.Dir.create in_dir);
|
||||||
List.iter (fun (path, value) ->
|
List.iter (fun (path, value) ->
|
||||||
let p = Fpath.append in_dir path in
|
let p = Fpath.append in_dir path in
|
||||||
ignore (Bos.OS.Dir.create (Fpath.parent p));
|
ignore (Bos.OS.Dir.create (Fpath.parent p));
|
||||||
|
@ -228,8 +229,10 @@ let handle t fd addr =
|
||||||
| Some job -> Lwt.return job
|
| Some job -> Lwt.return job
|
||||||
in
|
in
|
||||||
Lwt.bind (find_job ()) (fun job ->
|
Lwt.bind (find_job ()) (fun job ->
|
||||||
|
(* TODO set a timer / timeout and re-queue the same job if timeout expired *)
|
||||||
ignore (dump t);
|
ignore (dump t);
|
||||||
let uuid = uuid_gen () in
|
let uuid = uuid_gen () in
|
||||||
|
(* TODO if this write fails, put job back into queue! *)
|
||||||
write_cmd fd (Builder.Job_schedule (uuid, job)) >>= fun () ->
|
write_cmd fd (Builder.Job_schedule (uuid, job)) >>= fun () ->
|
||||||
Logs.app (fun m -> m "job %a scheduled %a"
|
Logs.app (fun m -> m "job %a scheduled %a"
|
||||||
Uuidm.pp uuid Builder.pp_job job);
|
Uuidm.pp uuid Builder.pp_job job);
|
||||||
|
|
Loading…
Reference in a new issue