From e0fc87d55749a3a1525e8ea07ff5f7afb288ff3f Mon Sep 17 00:00:00 2001 From: Yosef Mihretie Date: Tue, 26 Mar 2024 10:52:29 -0400 Subject: [PATCH] writing to exit file --- cron.py | 8 ++++---- shared.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cron.py b/cron.py index dde467c..c7e29e3 100644 --- a/cron.py +++ b/cron.py @@ -11,10 +11,10 @@ def main(): """ starts a no-op task that consumes resources """ - # print("consuming cpu") - # consume_cpu() - # print("consuming memory") - # consume_memory() + print("consuming cpu") + consume_cpu() + print("consuming memory") + consume_memory() print("sleeping for 70 seconds") time.sleep(70) diff --git a/shared.py b/shared.py index 028c9fe..07517e4 100644 --- a/shared.py +++ b/shared.py @@ -72,7 +72,7 @@ def handle_signal(signum, _): allowing other processes to stop doing work """ print(f"handling signal {signum}") - with open(exit_file(), "wb") as f: + with open(exit_file(), "w", encoding="utf-8") as f: f.write(signum)