[~] Refactor

This commit is contained in:
Siarhei Siniak 2022-09-03 15:21:41 +03:00
parent 33b78ca231
commit 6df412cf1e
2 changed files with 7 additions and 8 deletions

@ -87,6 +87,7 @@ def service():
logging.warning('start dynu_update')
need_wait = False
last_disabled = False
while True:
try:
@ -101,9 +102,13 @@ def service():
dynu_config = json.load(f)
if dynu_config.get('enabled') != True:
logging.warning('disabled')
if not last_disabled:
last_disabled = True
logging.warning('disabled')
need_wait = True
continue
else:
last_disabled = False
logging.warning('loaded dynu_config')
with multiprocessing.Pool(processes=1) as pool:

@ -3,10 +3,4 @@ WORKDIR /app
RUN pip3 install requests
ENTRYPOINT /bin/sh -c "\
while true; do \
date; \
python3 d1/dynu_update.py tmp/cache/dynu.auth.json ngrok; \
sleep 900; \
done; \
"
ENTRYPOINT exec python3 d1/dynu_update tmp/cache/dynu.auth.json ngrok