19 lines
476 B
Plaintext
Raw Normal View History

2023-03-28 08:48:09 +00:00
#!/usr/bin/env python3
""" This is a test script that saves leader status to json file every second"""
import json
import time
def update_leader_status():
while True:
data = {"status": "READY", "timestamp": int(time.time())}
with open(
"/competition/leader_node_status.json",
"w",
) as statusfile:
statusfile.write(json.dumps(data))
time.sleep(1)
if __name__ == "__main__":
update_leader_status()