mirror of
https://github.com/penpot/penpot.git
synced 2025-05-21 23:16:09 +02:00
✨ Reduce contention on file-update using advisory locks and weaker row locking.
This commit is contained in:
parent
2202f90d74
commit
144127224c
4 changed files with 37 additions and 10 deletions
|
@ -268,8 +268,9 @@
|
|||
(sv/defmethod ::update-file
|
||||
[{:keys [pool] :as cfg} {:keys [id profile-id] :as params}]
|
||||
(db/with-atomic [conn pool]
|
||||
(let [{:keys [id] :as file} (db/get-by-id conn :file id {:for-update 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)
|
||||
(db/xact-lock! conn id)
|
||||
(update-file (assoc cfg :conn conn)
|
||||
(assoc params :file file)))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue