From b09e7187ce46408df43856fc33c58bb200078ac7 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sat, 31 Dec 2022 11:54:51 -0700 Subject: [PATCH] Actually implement the liveness file --- stator/runner.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stator/runner.py b/stator/runner.py index 05ed4bc..7a39296 100644 --- a/stator/runner.py +++ b/stator/runner.py @@ -63,6 +63,10 @@ class StatorRunner: print(f" {label}: {number}") print("Running cleaning and scheduling") await self.run_scheduling() + # Write liveness file if configured + if self.liveness_file: + with open(self.liveness_file, "w") as fh: + fh.write(str(int(time.time()))) # Clear the cleaning breadcrumbs/extra for the main part of the loop sentry.scope_clear(scope)