From f711bbc940431ea0ceaed7b7e1fa4c338d30109e Mon Sep 17 00:00:00 2001 From: Jan Vales Date: Sun, 20 Jan 2019 18:39:32 +0100 Subject: [PATCH] Handle extreme initial boot-up time of camunda. --- camunda-overlay/camunda.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/camunda-overlay/camunda.py b/camunda-overlay/camunda.py index ad437a4..46a2957 100755 --- a/camunda-overlay/camunda.py +++ b/camunda-overlay/camunda.py @@ -6,6 +6,7 @@ import json import requests import argparse from pprint import pprint +import time CAMUNDA="http://localhost:8085/engine-rest/" @@ -259,7 +260,7 @@ def download_pdf(): except: pprint(res.content) -if __name__ == "__main__": +def main(): parser = argparse.ArgumentParser() parser.add_argument('--no-deploy', dest='deploy', default=True, action='store_false', help="Do not run the deployment step") parser.add_argument('--no-cleanup', dest='cleanup', default=True, action='store_false', help="Initial deploy does not need cleanup") @@ -282,3 +283,16 @@ if __name__ == "__main__": if args.autoclick >= 2: download_pdf() + + +if __name__ == "__main__": + loop_main = True + while loop_main: + try: + main() + loop_main = False + except KeyboardInterrupt: + raise + except: + print("looks bad - retry in 10 sec - "+str(sys.exc_info()[0])) + time.sleep(10) -- 2.43.0