Skip to content

Commit

Permalink
Treat INTERVAL <= 0 as only run once
Browse files Browse the repository at this point in the history
  • Loading branch information
reconman authored May 12, 2024
1 parent 455df66 commit e2481b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Docker/PlexAniSync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ services:
| SKIP_LIST_UPDATE | - | &#10005; | If set to True, it will NOT update your AniList which is useful if you want to do a test run to check if everything lines up properly. (default = False) |
| LOG_FAILED_MATCHES | - | &#10005; | If set to True, failed matches will be written to /plexanisync/failed_matches.txt (default = False) |
| SETTINGS_FILE | - | &#10005; | Location of a custom settings.ini for more advanced configuration. Makes all settings above obsolete. See section below for usage. |
| INTERVAL | 3600 | &#10005; | The time in between syncs in seconds |
| INTERVAL | 3600 | &#10005; | The time in between syncs in seconds. If this value is set to <= 0, the container will stop after the first sync. |
### Custom mappings
Expand Down
14 changes: 9 additions & 5 deletions Docker/PlexAniSync/run/runsync.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/bash
run() {
while true
do
(cd /plexanisync && python PlexAniSync.py)
sleep ${INTERVAL}
while true; do
python PlexAniSync.py
if [ ${INTERVAL} -gt 0 ]; then
sleep ${INTERVAL}
else
echo "Sync was completed and INTERVAL <= 0, quitting"
break
fi
done
}

Expand All @@ -13,7 +17,7 @@ run() {

if [[ -z ${SETTINGS_FILE} ]]; then
echo "Updating settings.ini"
python /plexanisync/settingsupdater.py
python settingsupdater.py
run
else
echo "Using custom config: "${SETTINGS_FILE}
Expand Down

0 comments on commit e2481b4

Please sign in to comment.