0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

📎 Minor change on locking order on update-file.

This commit is contained in:
Andrey Antukh 2021-06-09 15:53:38 +02:00
parent b9df489962
commit 55b0f6e950

View file

@ -268,9 +268,9 @@
(sv/defmethod ::update-file
[{:keys [pool] :as cfg} {:keys [id profile-id] :as params}]
(db/with-atomic [conn pool]
(db/xact-lock! conn id)
(let [{:keys [id] :as file} (db/get-by-id conn :file id {:for-key-share true})]
(files/check-edition-permissions! conn profile-id id)
(db/xact-lock! conn id)
(update-file (assoc cfg :conn conn)
(assoc params :file file)))))