Commit 0e8ac26e authored by Tim Schoof's avatar Tim Schoof
Browse files

Use different timeouts in sender for broker/producer

parent 0f4590a9
......@@ -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=30000)
))
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)
))
......
Supports Markdown
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