From 0ced80065af1720ae3579c95834607f7ce5b9715 Mon Sep 17 00:00:00 2001 From: Oleksandr Tsurenko Date: Thu, 11 May 2023 20:16:18 +0200 Subject: [PATCH] TECH-1204 - Getting back to working version --- chief_keeper/chief_keeper.py | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/chief_keeper/chief_keeper.py b/chief_keeper/chief_keeper.py index 25c69c6..3d76c15 100644 --- a/chief_keeper/chief_keeper.py +++ b/chief_keeper/chief_keeper.py @@ -35,7 +35,18 @@ from auction_keeper.gas import DynamicGasPrice -from functools import wraps +HEALTHCHECK_FILE_PATH = "/tmp/health.log" + + +def healthy(func): + def wrapper(*args, **kwargs): + ts = int(time.time()) + print(f"Health-check passed, timestamp: {ts}") + with open(HEALTHCHECK_FILE_PATH, "w") as f: + f.write(str(ts) + "\n") + return func(*args, **kwargs) + + return wrapper class ChiefKeeper: @@ -130,12 +141,7 @@ def __init__(self, args: list, **kwargs): parser.add_argument( "--gas-maximum", type=str, default=5000, help="gas strategy tuning" ) - parser.add_argument( - "--health-check-file-path", - type=str, - default="/tmp/health.log", - help="path to health-check file", - ) + parser.set_defaults(cageFacilitated=False) self.arguments = parser.parse_args(args) @@ -181,17 +187,6 @@ def __init__(self, args: list, **kwargs): level=(logging.DEBUG if self.arguments.debug else logging.INFO), ) - def healthy(func): - @wraps(func) - def wrapper(self, *args, **kwargs): - ts = int(time.time()) - self.logger.info(f"Health-check passed: {ts}") - with open(self.arguments.health_check_file_path, "w") as f: - f.write(str(ts) + "\n") - return func(*args, **kwargs) - - return wrapper - def main(self): """Initialize the lifecycle and enter into the Keeper Lifecycle controller.