Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FS-SC
AsapoWorker
Commits
0e8ac26e
Commit
0e8ac26e
authored
Jun 17, 2020
by
Tim Schoof
Browse files
Use different timeouts in sender for broker/producer
parent
0f4590a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/AsapoWorker/asapo_sender.py
View file @
0e8ac26e
...
...
@@ -10,8 +10,9 @@ log = logging.getLogger(__name__)
def
create_producer
(
source
,
beamtime
,
beamline
,
stream
,
token
,
nthreads
=
1
,
timeout
=
3000
):
timeout
=
timeout
/
1000
source
,
beamtime
,
beamline
,
stream
,
token
,
nthreads
=
1
,
timeout_producer
=
30000
):
timeout
=
timeout_producer
/
1000
log
.
info
(
"Create new producer (source=%s, beamtime=%s, beamline=%s, "
"stream=%s, token=%s, nthreads=%i, timeout=%s)."
,
...
...
@@ -22,14 +23,16 @@ def create_producer(
def
create_broker
(
source
,
path
,
has_filesystem
,
beamtime
,
stream
,
token
,
timeout
):
source
,
path
,
has_filesystem
,
beamtime
,
stream
,
token
,
timeout_consumer
=
3000
):
log
.
info
(
"Create new broker (source=%s, path=%s, has_filesystem=%s, "
"beamtime=%s, stream=%s, token=%s, timeout=%i)."
,
source
,
path
,
has_filesystem
,
beamtime
,
stream
,
token
,
timeout
)
"beamtime=%s, stream=%s, token=%s, timeout
_consumer
=%i)."
,
source
,
path
,
has_filesystem
,
beamtime
,
stream
,
token
,
timeout
_consumer
)
try
:
broker
=
asapo_consumer
.
create_server_broker
(
source
,
path
,
has_filesystem
,
beamtime
,
stream
,
token
,
timeout
)
source
,
path
,
has_filesystem
,
beamtime
,
stream
,
token
,
timeout_consumer
)
except
asapo_consumer
.
AsapoWrongInputError
as
err
:
raise
ConfigurationError
(
"Cannot create broker"
)
from
err
except
asapo_consumer
.
AsapoConsumerError
as
err
:
...
...
@@ -72,9 +75,9 @@ class AsapoSender:
"Name of output stream"
,
type
=
str
,
default
=
""
),
nthreads
=
Config
(
"Number of threads"
,
type
=
int
,
default
=
1
),
timeout
=
Config
(
timeout
_producer
=
Config
(
"Allowed time in milliseconds for ASAP::O data access before "
"exception is thrown"
,
type
=
float
,
default
=
3000
)
"exception is thrown"
,
type
=
float
,
default
=
3000
0
)
))
broker
=
Config
(
"An ASAP::O consumer broker"
,
type
=
asapo_consumer
.
PyDataBroker
,
...
...
@@ -88,7 +91,7 @@ class AsapoSender:
has_filesystem
=
Config
(
"Read files directly from filesystem"
,
type
=
bool
,
default
=
False
),
timeout
=
Config
(
timeout
_consumer
=
Config
(
"Allowed time in milliseconds for ASAP::O data access before "
"exception is thrown"
,
type
=
float
,
default
=
3000
)
))
...
...
Write
Preview
Supports
Markdown
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