Spaces:
Running
Running
| # maintenance_control.py | |
| import os, json | |
| MAINTENANCE_FILE = "/data/maintenance.json" | |
| def is_maintenance_mode(): | |
| if os.path.exists(MAINTENANCE_FILE): | |
| with open(MAINTENANCE_FILE) as f: | |
| return json.load(f).get("active", False) | |
| return False | |
| def set_maintenance_mode(active: bool): | |
| with open(MAINTENANCE_FILE, "w") as f: | |
| json.dump({"active": active}, f) |