diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9efac72..9364091 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,8 +2,7 @@ name: 'Update schedule' on: schedule: - - cron: '0 22 * * *' - - cron: '0 10 * * *' + - cron: '0 22,10 * * *' workflow_dispatch: branches: - master diff --git a/Dockerfile b/Dockerfile index d90b5eb..4921952 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,8 +20,7 @@ ENV APP_WORKDIR=$APP_WORKDIR ENV LITE=$LITE ENV APP_PORT=8000 ENV PATH="/.venv/bin:$PATH" -ENV UPDATE_CRON1="0 22 * * *" -ENV UPDATE_CRON2="0 10 * * *" +ENV UPDATE_CRON="0 22,10 * * *" WORKDIR $APP_WORKDIR diff --git a/README.md b/README.md index 486a0ff..77d190f 100644 --- a/README.md +++ b/README.md @@ -279,8 +279,7 @@ docker run -d -p 8000:8000 guovern/iptv-api:lite - 定时执行时间 ```bash --e UPDATE_CRON1="0 22 * * *" --e UPDATE_CRON2="0 10 * * *" +-e UPDATE_CRON="0 22,10 * * *" ``` #### 3. 更新结果 diff --git a/README_en.md b/README_en.md index b531163..cddb6af 100644 --- a/README_en.md +++ b/README_en.md @@ -25,7 +25,8 @@ [中文](./README.md) | English -✨💻[IPTV-Web](https://github.com/Guovin/iptv-web): IPTV live stream management platform, supports online playback and other features, under development... +✨💻[IPTV-Web](https://github.com/Guovin/iptv-web): IPTV live stream management platform, supports online playback and +other features, under development... - [✅ Features](#features) - [🔗 Latest results](#latest-results) @@ -287,8 +288,7 @@ Taking the host path /etc/docker as an example: - Scheduled execution time ```bash --e UPDATE_CRON1="0 22 * * *" --e UPDATE_CRON2="0 10 * * *" +-e UPDATE_CRON="0 22,10 * * *" ``` #### 3. Update results diff --git a/docs/tutorial.md b/docs/tutorial.md index 6eca218..9f625e5 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -344,8 +344,7 @@ docker run -d -p 8000:8000 guovern/iptv-api:lite - 定时执行时间 ```bash --e UPDATE_CRON1="0 22 * * *" --e UPDATE_CRON2="0 10 * * *" +-e UPDATE_CRON="0 22,10 * * *" ``` ### 3. 更新结果 diff --git a/docs/tutorial_en.md b/docs/tutorial_en.md index 03f204b..c8a506b 100644 --- a/docs/tutorial_en.md +++ b/docs/tutorial_en.md @@ -377,8 +377,7 @@ Using the host path `/etc/docker` as an example: - Scheduled execution time ```bash --e UPDATE_CRON1="0 22 * * *" --e UPDATE_CRON2="0 10 * * *" +-e UPDATE_CRON="0 22,10 * * *" ``` ### 3. Update results diff --git a/entrypoint.sh b/entrypoint.sh index 3739b20..f2a96c6 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,11 +12,9 @@ done crontab -d -for cron_value in "$UPDATE_CRON1" "$UPDATE_CRON2"; do - if [ -n "$cron_value" ]; then - (crontab -l ; echo "$cron_value cd $APP_WORKDIR && /.venv/bin/python main.py") | crontab - - fi -done +if [ -n "$UPDATE_CRON" ]; then + (crontab -l ; echo "$UPDATE_CRON cd $APP_WORKDIR && /.venv/bin/python main.py") | crontab - +fi # dcron log level # LOG_EMERG 0 [* system is unusable *]