Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
ocluster
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fardale
ocluster
Commits
215e555f
Commit
215e555f
authored
Mar 05, 2019
by
Fardale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use async in the master and add parallelism
parent
331d68ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
26 deletions
+27
-26
master.ml
master.ml
+27
-26
No files found.
master.ml
View file @
215e555f
...
...
@@ -69,33 +69,34 @@ let server_handler pass port sockaddr (ic, _oc) =
|
Result
.
Ok
query
->
(
match
query
with
|
`RESULT
result
->
if
pass
=
result
.
pass
then
(
(*Lwt_io.write oc "true"
<&>*)
Logs_lwt
.
debug
(
fun
m
->
m
"Receive result: %s
\n
"
(
Serialization_j
.
string_of_result
{
result
with
stdout
=
"<stdout>"
;
stderr
=
"<stderr>"
})
)
>>=
fun
()
->
Lwt_io
.
with_file
~
mode
:
Lwt_io
.
output
(
Printf
.
sprintf
"ocluster_%i_%i.out"
(
fst
result
.
id
)
(
snd
result
.
id
))
(
fun
oc
->
Lwt_io
.
write
oc
result
.
stdout
)
>>=
fun
()
->
Lwt_io
.
with_file
~
mode
:
Lwt_io
.
output
(
Printf
.
sprintf
"ocluster_%i_%i.err"
(
fst
result
.
id
)
(
snd
result
.
id
))
(
fun
oc
->
Lwt_io
.
write
oc
result
.
stderr
)
if
pass
=
result
.
pass
then
Logs_lwt
.
debug
(
fun
m
->
m
"Receive result: %s
\n
"
(
Serialization_j
.
string_of_result
{
result
with
stdout
=
"<stdout>"
;
stderr
=
"<stderr>"
})
)
>>=
fun
()
->
Lwt_io
.
with_file
~
mode
:
Lwt_io
.
output
(
Printf
.
sprintf
"ocluster_%i_%i.log"
(
fst
result
.
id
)
(
snd
result
.
id
))
(
fun
oc
->
Lwt_io
.
write
oc
(
Printf
.
sprintf
"Job completed at %f
\n
Return code: %s
\n
"
(
Unix
.
time
()
)
(
string_of_ret_code
result
.
ret_code
))
)
>>=
fun
()
->
end_job
result
.
id
sockaddr
;
launch_job
()
)
Lwt
.
return
(
Lwt
.
async
(
fun
()
->
Lwt
.
join
[
Lwt_io
.
with_file
~
mode
:
Lwt_io
.
output
(
Printf
.
sprintf
"ocluster_%i_%i.out"
(
fst
result
.
id
)
(
snd
result
.
id
))
(
fun
oc
->
Lwt_io
.
write
oc
result
.
stdout
)
;
Lwt_io
.
with_file
~
mode
:
Lwt_io
.
output
(
Printf
.
sprintf
"ocluster_%i_%i.err"
(
fst
result
.
id
)
(
snd
result
.
id
))
(
fun
oc
->
Lwt_io
.
write
oc
result
.
stderr
)
;
Lwt_io
.
with_file
~
mode
:
Lwt_io
.
output
(
Printf
.
sprintf
"ocluster_%i_%i.log"
(
fst
result
.
id
)
(
snd
result
.
id
))
(
fun
oc
->
Lwt_io
.
write
oc
(
Printf
.
sprintf
"Job completed at %f
\n
Return code: %s
\n
"
(
Unix
.
time
()
)
(
string_of_ret_code
result
.
ret_code
))
)
;
end_job
result
.
id
sockaddr
>>=
Lwt
.
pause
>>=
launch_job
]
))
else
(*Lwt_io.write oc "Wrong password"
<&>*)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment