Skip to content

Commit aee9735

Browse files
committed
update run.py
1 parent aa0a8e9 commit aee9735

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ RUN ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /
1010
RUN pip install poetry==1.1.4 && poetry config virtualenvs.create false --local
1111
RUN poetry install --no-root --no-dev
1212

13-
CMD [ "python", "./run.py" ]
13+
CMD [ "python", "-u", "run.py" ]

run.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import sentry_sdk
1212

1313
from hydra.spider import *
14-
from hydra.config import Config
14+
from hydra.config import Config, logger
1515

1616
sentry_config = Config.sentry_config()
1717
sentry_sdk.init(**sentry_config)
@@ -29,12 +29,13 @@ def job():
2929

3030
schedule.every().day.at("06:30").do(job)
3131
schedule.every().day.at("11:30").do(job)
32+
schedule.every().day.at("18:30").do(job)
3233
schedule.every().day.at("21:00").do(job)
3334

34-
print("Start running job...")
35+
logger.info("Start running job...")
3536
try:
3637
while True:
3738
schedule.run_pending()
3839
time.sleep(1)
3940
except Exception as e:
40-
print(f"Running schedule error: {e}")
41+
logger.error(f"Running schedule error: {e}")

0 commit comments

Comments
 (0)