mrusse / soularr

A Python script that connects Lidarr with Soulseek!
77 stars 7 forks source link

Lock file remains if docker container doesn't exit gracefully #16

Closed aurvandel closed 4 weeks ago

aurvandel commented 1 month ago

Performing a docker compose down command on the container while the script is running doesn't trigger any type of code to delete the lock file. This causes the script to run but never import anything and just report that the instance is already running and waits the configured amount of seconds after you start the container again because the lock still exists. Probably just need to listen for interrupts in order to avoid missing the code to delete the lock file.

mrusse commented 1 month ago

@kappa118 Any ideas for this? At least for Docker the locking file seems redudent now since shell script itself checks if the script is running before running the python script. Maybe we could only make a locking file if is_docker() is False. Unless there is a better solution.

shpwatkin1 commented 1 month ago

You could also just change where the lock file is created. Currently it's in the persistent data folder so it survives when the container is destroyed. Moving it to non persistent storage is probably the easiest way to resolve this.

aurvandel commented 4 weeks ago

Submitted a PR to fix this issue. #20

mrusse commented 4 weeks ago

Fixed with https://github.com/mrusse/soularr/pull/20. Thank you.