[~] Refactor
This commit is contained in:
parent
33b78ca231
commit
6df412cf1e
@ -87,6 +87,7 @@ def service():
|
|||||||
logging.warning('start dynu_update')
|
logging.warning('start dynu_update')
|
||||||
|
|
||||||
need_wait = False
|
need_wait = False
|
||||||
|
last_disabled = False
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
@ -101,9 +102,13 @@ def service():
|
|||||||
dynu_config = json.load(f)
|
dynu_config = json.load(f)
|
||||||
|
|
||||||
if dynu_config.get('enabled') != True:
|
if dynu_config.get('enabled') != True:
|
||||||
logging.warning('disabled')
|
if not last_disabled:
|
||||||
|
last_disabled = True
|
||||||
|
logging.warning('disabled')
|
||||||
|
need_wait = True
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
|
last_disabled = False
|
||||||
logging.warning('loaded dynu_config')
|
logging.warning('loaded dynu_config')
|
||||||
|
|
||||||
with multiprocessing.Pool(processes=1) as pool:
|
with multiprocessing.Pool(processes=1) as pool:
|
||||||
|
@ -3,10 +3,4 @@ WORKDIR /app
|
|||||||
|
|
||||||
RUN pip3 install requests
|
RUN pip3 install requests
|
||||||
|
|
||||||
ENTRYPOINT /bin/sh -c "\
|
ENTRYPOINT exec python3 d1/dynu_update tmp/cache/dynu.auth.json ngrok
|
||||||
while true; do \
|
|
||||||
date; \
|
|
||||||
python3 d1/dynu_update.py tmp/cache/dynu.auth.json ngrok; \
|
|
||||||
sleep 900; \
|
|
||||||
done; \
|
|
||||||
"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user