From 21a902a6033ed5737190409e09be0dfdc3083f23 Mon Sep 17 00:00:00 2001 From: Rob Kooper Date: Tue, 2 Aug 2022 10:08:20 -0500 Subject: [PATCH] fix heartbeat --- CHANGELOG.md | 4 ++++ pyclowder/extractors.py | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cae7795..9941309 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,13 @@ This will change how clowder sees the extractors. If you have an extractor, and the queue name (eiter as command line argument or environment variable) the name of the extractor shown in clowder, will be the name of the queue. +### Fixed +- both heartbeat and nax_retry need to be converted to in, not string + ### Changed - when you set the RABBITMQ_QUEUE it will change the name of the extractor as well in the extractor_info document. [#47](https://github.com/clowder-framework/pyclowder/issues/47) +- environment variable CLOWDER_MAX_RETRY is now MAX_RETRY ## 2.5.1 - 2022-03-04 diff --git a/pyclowder/extractors.py b/pyclowder/extractors.py index 12131a2..55fe3a0 100644 --- a/pyclowder/extractors.py +++ b/pyclowder/extractors.py @@ -73,8 +73,8 @@ def __init__(self): connector_default = "RabbitMQ" if os.getenv('LOCAL_PROCESSING', "False").lower() == "true": connector_default = "Local" - max_retry = os.getenv('CLOWDER_MAX_RETRY', 10) - heartbeat = os.getenv('HEARTBEAT', 5*60) + max_retry = int(os.getenv('MAX_RETRY', 10)) + heartbeat = int(os.getenv('HEARTBEAT', 5*60)) # create the actual extractor self.parser = argparse.ArgumentParser(description=self.extractor_info['description']) @@ -111,7 +111,7 @@ def __init__(self): self.parser.add_argument('--no-bind', dest="nobind", action='store_true', help='instance will bind itself to RabbitMQ by name but NOT file type') self.parser.add_argument('--max-retry', dest='max_retry', default=max_retry, - help='Maximum number of retries if an error happens in the extractor') + help='Maximum number of retries if an error happens in the extractor (default=%d)' % max_retry) self.parser.add_argument('--heartbeat', dest='heartbeat', default=heartbeat, help='Time in seconds between extractor heartbeats (default=%d)' % heartbeat)