Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
dcdb
dcdb
Commits
f68f392a
Commit
f68f392a
authored
Aug 03, 2020
by
Michael Ott
Browse files
Introduce new parameter -o to set MQTT timeout
parent
537cf1c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/dcdbslurmjob/dcdbslurmjob.cpp
View file @
f68f392a
...
...
@@ -38,10 +38,6 @@
#include
"dcdb/version.h"
#include
"version.h"
#define SLURMJOBTIMEOUT 60000000000
int
msgId
=
-
1
;
bool
done
=
false
;
...
...
@@ -64,6 +60,7 @@ void usage() {
std
::
cout
<<
"Options:"
<<
std
::
endl
;
std
::
cout
<<
" -b<hosts> List of MQTT brokers [default: localhost:1883]"
<<
std
::
endl
;
std
::
cout
<<
" -q<qos> MQTT QoS to use [default: 0]"
<<
std
::
endl
;
std
::
cout
<<
" -o<timeout> MQTT timeout in seconds [default: 10]"
<<
std
::
endl
;
std
::
cout
<<
" -c<hosts> List of Cassandra hosts [default: none]"
<<
std
::
endl
;
std
::
cout
<<
" -u<username> Cassandra username [default: none]"
<<
std
::
endl
;
std
::
cout
<<
" -p<password> Cassandra password [default: none]"
<<
std
::
endl
;
...
...
@@ -178,10 +175,11 @@ int main(int argc, char** argv) {
std
::
string
substitution
=
""
;
int
maxJobLength
=
-
1
;
int
qos
=
0
;
int
timeout
=
10
;
uint64_t
ts
=
0
;
// Defining options
const
char
*
opts
=
"b:q:c:u:p:n:t:j:i:s:m:h"
;
const
char
*
opts
=
"b:q:
o:
c:u:p:n:t:j:i:s:m:h"
;
char
ret
;
while
((
ret
=
getopt
(
argc
,
argv
,
opts
))
!=-
1
)
{
...
...
@@ -214,6 +212,9 @@ int main(int argc, char** argv) {
case
'q'
:
qos
=
atoi
(
optarg
);
break
;
case
'o'
:
timeout
=
atoi
(
optarg
);
break
;
case
'c'
:
cassandra
=
true
;
splitHostList
(
optarg
,
hostList
);
...
...
@@ -446,7 +447,7 @@ int main(int argc, char** argv) {
retCode
=
1
;
goto
exit
;
}
}
while
(
!
done
&&
getTimestamp
()
-
startTs
<
S
LURMJOBTIMEOUT
);
}
while
(
!
done
&&
getTimestamp
()
-
startTs
<
S
_TO_NS
(
timeout
)
);
}
//hasta la vista
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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