Compare commits
No commits in common. "a0e06d3ef8c3f325a825c8d55be7b596ee4e9a82" and "f191d7c07aa68332289911804e59cb6210a376c0" have entirely different histories.
a0e06d3ef8
...
f191d7c07a
5
main.py
5
main.py
@ -52,6 +52,7 @@ def get_hosts() -> list[str]:
|
|||||||
f"http://configurator/api/v1/fetch?project=certupdater&stage={os.getenv("STAGE")}"
|
f"http://configurator/api/v1/fetch?project=certupdater&stage={os.getenv("STAGE")}"
|
||||||
).json()
|
).json()
|
||||||
hosts = response["configs"]["hosts"]
|
hosts = response["configs"]["hosts"]
|
||||||
|
print(f"got hosts {hosts}")
|
||||||
return list(hosts)
|
return list(hosts)
|
||||||
|
|
||||||
|
|
||||||
@ -107,10 +108,8 @@ def update_host(host: str) -> str | None:
|
|||||||
while True:
|
while True:
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
mongo_hosts = mongo.hosts
|
mongo_hosts = mongo.hosts
|
||||||
hosts = get_hosts()
|
|
||||||
print(f"got hosts {hosts}")
|
|
||||||
updated = False
|
updated = False
|
||||||
for host in hosts:
|
for host in get_hosts():
|
||||||
if (
|
if (
|
||||||
now + datetime.timedelta(days=14)
|
now + datetime.timedelta(days=14)
|
||||||
> mongo_hosts.get(
|
> mongo_hosts.get(
|
||||||
|
Loading…
Reference in New Issue
Block a user