Add interval

This commit is contained in:
Jack Hadrill
2024-11-12 23:35:33 +00:00
parent 5e16d16062
commit 0398f2ed3d
2 changed files with 5 additions and 1 deletions

3
app.py
View File

@@ -2,6 +2,7 @@
OVH API to order a dedicated server
"""
import os
import time
import ovh
APP_KEY = os.environ.get("OVH_APP_KEY")
@@ -13,6 +14,7 @@ DATACENTERS = os.environ.get("OVH_DATACENTERS", "lon,gra,rbx")
PLAN_CODE = os.environ.get("OVH_PLAN_CODE")
OPTIONS = os.environ.get("OVH_OPTIONS")
QUANTITY = int(os.environ.get("OVH_QUANTITY", "1"))
INTERVAL = int(os.environ.get("OVH_INTERVAL", "5"))
REGION = "ovh-eu"
ZONE = "IE"
@@ -172,3 +174,4 @@ if __name__ == "__main__":
if PURCHASED == QUANTITY:
print("🎉 Complete")
break
time.sleep(INTERVAL)

View File

@@ -10,4 +10,5 @@ services:
- OVH_DATACENTERS=${OVH_DATACENTERS}
- OVH_PLAN_CODE=${OVH_PLAN_CODE}
- OVH_OPTIONS=${OVH_OPTIONS}
- OVH_QUANTITY=${OVH_QUANTITY}
- OVH_QUANTITY=${OVH_QUANTITY}
- OVH_INTERVAL=${OVH_INTERVAL}