mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 21:09:00 -05:00
📎 Minor change on locking order on update-file.
This commit is contained in:
parent
b9df489962
commit
55b0f6e950
1 changed files with 1 additions and 1 deletions
|
@ -268,9 +268,9 @@
|
||||||
(sv/defmethod ::update-file
|
(sv/defmethod ::update-file
|
||||||
[{:keys [pool] :as cfg} {:keys [id profile-id] :as params}]
|
[{:keys [pool] :as cfg} {:keys [id profile-id] :as params}]
|
||||||
(db/with-atomic [conn pool]
|
(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})]
|
(let [{:keys [id] :as file} (db/get-by-id conn :file id {:for-key-share true})]
|
||||||
(files/check-edition-permissions! conn profile-id id)
|
(files/check-edition-permissions! conn profile-id id)
|
||||||
(db/xact-lock! conn id)
|
|
||||||
(update-file (assoc cfg :conn conn)
|
(update-file (assoc cfg :conn conn)
|
||||||
(assoc params :file file)))))
|
(assoc params :file file)))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue