scdl-org / scdl

Soundcloud Music Downloader
GNU General Public License v2.0
3.41k stars 339 forks source link

Delete *.scdl.lock after all processes are complete #490

Closed adithayyil closed 5 months ago

adithayyil commented 5 months ago

I am not sure how the behaviour is in Windows. But in UNIX, the lock files are not deleted when released because of race conditions. See here. For scdl specifically, I would assume that the lock files are not needed when there are no scdl processes running anymore? If so, we need to have some sort of deleting mechanism because directories would get messy after some point.

7x11x13 commented 5 months ago

Oh that's annoying... I guess we should keep the lockfiles in a tempdir as suggested here (if we are not on Windows): https://github.com/tox-dev/filelock/issues/76#issuecomment-696409014

adithayyil commented 5 months ago

yup that would work I think. we can also keep it hidden like ./.scdl.locks/, and when the process exits or finishes we can simply remove the dir.

7x11x13 commented 5 months ago

Should be fixed now