diff --git a/main.py b/main.py index dc22e69..c8f34cd 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,7 @@ def job_wrapper(): if __name__ == '__main__': - schedule.every(1).minutes.do(job_wrapper) + schedule.every(5).minutes.do(job_wrapper) while True: schedule.run_pending() diff --git a/src/aws_lightsail_guard/guard.py b/src/aws_lightsail_guard/guard.py index a74b1ab..3913d30 100644 --- a/src/aws_lightsail_guard/guard.py +++ b/src/aws_lightsail_guard/guard.py @@ -1,4 +1,5 @@ import logging +import os from datetime import datetime from aws_lightsail_guard.lightsail import lightsail, lightsail_domain @@ -46,7 +47,7 @@ def lightsail_instance_public_ip_keepalive(self, name): get_domains_response = lightsail_domain.get_domains() for domain in get_domains_response['domains']: for domainEntry in domain['domainEntries']: - if domainEntry['target'] == 't5.coolbeevip.com': + if domainEntry['name'] == os.environ['DOMAIN_ENTRY_NAME']: lightsail_domain.update_domain_entry( domainName=domain['name'], domainEntry={