Skip to content

Commit

Permalink
feat: xiaoya-emd adds process lock
Browse files Browse the repository at this point in the history
  • Loading branch information
DDSRem committed Dec 17, 2024
1 parent 2ce676c commit 1859a04
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions emby_metadata_downloader/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@ function mount_img() {

}

function main_solid() {

cd /app || return 1
if [ -f /media/solid.lock ]; then
WARN "当前已有爬虫进程在运行,跳过本次运行!"
else
touch /media/solid.lock
INFO "开始下载同步!"
INFO "python3 solid.py $*"
python3 solid.py $@
INFO "运行完成!"
rm -f /media/solid.lock
fi

}

if [ "${IMG_VOLUME}" == "true" ]; then
mount_img
fi
Expand All @@ -87,11 +103,7 @@ else
update_app
INFO "更新成功!"
fi
cd /app || exit
INFO "开始下载同步!"
INFO "python3 solid.py $*"
python3 solid.py $@
INFO "运行完成!"
main_solid $@
INFO "等待${CYCLE}秒后下次运行!"
sleep "${CYCLE}"
done
Expand Down

0 comments on commit 1859a04

Please sign in to comment.