From 05b5a4aa61b058e89c4a9a19dbe49d49f40d7079 Mon Sep 17 00:00:00 2001 From: drjones Date: Sat, 19 Sep 2026 19:31:50 -0700 Subject: [PATCH] Expire past-due dedicated IPs in provisioning poll --- app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.py b/app.py index 58b12a9..db01399 100644 --- a/app.py +++ b/app.py @@ -401,6 +401,12 @@ def poll_provisioning(): failed += 1 except Exception as e: app.logger.warning("poll order %s failed: %s", row["iproyal_order_id"], e) + # expire past-due active IPs + d = db.get_db() + d.execute("UPDATE dedicated_ips SET status='expired' WHERE status='active' " + "AND expires_at > 0 AND expires_at < ?", (int(time.time()),)) + d.commit() + d.close() return ok, failed