Expire past-due dedicated IPs in provisioning poll

This commit is contained in:
drjones
2026-09-19 19:31:50 -07:00
parent 808afbe3f4
commit 05b5a4aa61

6
app.py
View File

@@ -401,6 +401,12 @@ def poll_provisioning():
failed += 1 failed += 1
except Exception as e: except Exception as e:
app.logger.warning("poll order %s failed: %s", row["iproyal_order_id"], 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 return ok, failed