SynoCommunity / spkrepo

Synology Package Repository
http://spkrepo.readthedocs.org
MIT License
152 stars 26 forks source link

Make a directory safely without raising error #101

Closed mreid-tt closed 1 year ago

mreid-tt commented 1 year ago

During the upload of SPK files, if this is for a new package or version, folders and corresponding database entries are created. During this process, if there are multiple concurrent requests there is a risk that one process may be attempting to create a folder after another process has already done so. This would result in an exception that can cause the cleanup of folders to occur and put the system into an inconsistent state. This PR changes the way folders are created to not raise an error if one already exists to avoid this.

Fixes: https://github.com/SynoCommunity/spkrepo/issues/95

mreid-tt commented 1 year ago

@Diaoul, much thanks for approving this PR. You mentioned creating a release to get the previous changes implemented in the production server. Let me know if I can be of assistance to get this done.

mreid-tt commented 10 months ago

@Diaoul, any cycles available to revisit pushing this to the live repo?

hgy59 commented 10 months ago

@mreid-tt I hope we can revert #99 to solve #106 before going live.

mreid-tt commented 10 months ago

@Diaoul, I mean sure. I don't mind rolling back any of my previous PRs if we can get the repo unstuck. My understanding from your previous comments was that there was something in there from before which was causing it to crash when we tried to go live with the code. I don't know if this was also the reason the GitHub tests seem to fail.