Commit 331d68ad authored by Fardale's avatar Fardale

Insert Lwt.pause in the sequential code

parent 252512c7
......@@ -20,6 +20,8 @@ let string_of_sockaddr = function
let end_job id sockaddr =
let n, l = SHashtbl.find nodes (string_of_sockaddr sockaddr) in
let j = List.find (fun c -> c.id = id) l in
Lwt.pause ()
>|= fun () ->
SHashtbl.replace nodes
(string_of_sockaddr sockaddr)
( {n with cpu= n.cpu + j.cpu; ram= n.ram + j.ram}
......@@ -57,7 +59,7 @@ let rec launch_job () =
Lwt_io.write oc (Serialization_j.string_of_query (`COMPUTATION j))
)
(* TODO: check return value *)
>>= launch_job )
>>= Lwt.pause >>= launch_job )
else Logs_lwt.debug (fun m -> m "No compuatiton\n")
let server_handler pass port sockaddr (ic, _oc) =
......
......@@ -44,7 +44,6 @@ let handle_computation sockaddr computation () =
>>= fun () ->
Logs_lwt.debug (fun m ->
m "End computation %i,%i\n" (fst computation.id) (snd computation.id) )
>>= fun () -> Lwt_unix.sleep 2.
let stat oc = Lwt_io.write_value oc `OK
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment