Commit c35bccdc authored by Fardale's avatar Fardale

cleanup

parent 932eb5d1
......@@ -97,8 +97,7 @@ let server_handler pass port sockaddr (ic, oc) =
m "Receive result: %s"
(Serialization_j.string_of_result
{result with stdout= "<stdout>"; stderr= "<stderr>"}))
>>= fun () ->
Lwt.return
>|= fun () ->
(Lwt.async (fun () ->
Lwt.join
[ ( if String.length result.stdout > 0 then
......@@ -173,7 +172,6 @@ let server_handler pass port sockaddr (ic, oc) =
Lwt_io.write_line oc
(Serialization_j.string_of_query_data (`JOBS jobs_list))
>>= fun () -> Lwt_io.flush oc)
>>= fun () -> Lwt.return_unit
| _ ->
Lwt_io.write_line oc
(Serialization_j.string_of_answer (`Error "Unwanted command"))
......
......@@ -31,8 +31,7 @@ let run_computation (computation : computation) =
Lwt_unix.close read_stderr
>>= fun () ->
Lwt_unix.close read_stdout
>>= fun () ->
Lwt.return
>|= fun () ->
{ id= computation.id
; stdout=
( if String.length stdout > max_std then
......@@ -64,20 +63,20 @@ let rec send_result sockaddr pass result =
Logs_lwt.debug (fun m ->
m "Result %i,%i successfully sent." (fst result.id)
(snd result.id))
>>= fun () -> Lwt.return false
>|= fun () -> false
| `Error s ->
Logs_lwt.err (fun m ->
m "Error during the reception of the result %i,%i: %s"
(fst result.id) (snd result.id) s)
>>= fun () -> Lwt.return true )
>|= fun () -> true )
| Error e ->
Logs_lwt.err (fun m ->
m "Error during the reception of the answer: %s"
(Printexc.to_string e))
>>= fun () -> Lwt.return true
>|= fun () -> true
with End_of_file ->
Logs_lwt.err (fun m -> m "Error during the read of the answer: EOF")
>>= fun () -> Lwt.return true)
>|= fun () -> true)
then send_result sockaddr pass result
let handle_computation sockaddr pass computation () =
......
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