Expire past-due dedicated IPs in provisioning poll
This commit is contained in:
6
app.py
6
app.py
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user