Reset All

This commit is contained in:
proitlab committed 2026-07-29 16:02:26 +07:00
1 parent 3941d75d95
commit e8893a3aa4
1 file changed
+10 -2
+10 -2
View File
@@ -551,8 +551,16 @@ def export_day_xlsx(date):
@app.route("/api/reset", methods=["POST"])
def api_reset():
try:
Path(CURRENT_BATCH_PATH).unlink(missing_ok=True)
Path(str(CURRENT_BATCH_PATH) + ".reset").touch()
paths = {CURRENT_BATCH_PATH}
sf = os.getenv("STATE_FILE")
if sf:
paths.add(sf)
cb = os.getenv("CURRENT_BATCH_PATH")
if cb:
paths.add(cb)
for p in paths:
Path(p).unlink(missing_ok=True)
Path(str(p) + ".reset").touch()
Path(LIVE_STREAM_FRAME_PATH).unlink(missing_ok=True)
except Exception:
pass