mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 15:39:50 -05:00
✨ Use new retry mechanism on comment thread creation
This commit is contained in:
parent
d80a24b1e3
commit
c9c070b5f4
1 changed files with 7 additions and 5 deletions
|
@ -14,8 +14,8 @@
|
||||||
[app.rpc.commands.files :as files]
|
[app.rpc.commands.files :as files]
|
||||||
[app.rpc.commands.teams :as teams]
|
[app.rpc.commands.teams :as teams]
|
||||||
[app.rpc.doc :as-alias doc]
|
[app.rpc.doc :as-alias doc]
|
||||||
[app.rpc.retry :as retry]
|
|
||||||
[app.util.blob :as blob]
|
[app.util.blob :as blob]
|
||||||
|
[app.util.retry :as rtry]
|
||||||
[app.util.services :as sv]
|
[app.util.services :as sv]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[clojure.spec.alpha :as s]))
|
[clojure.spec.alpha :as s]))
|
||||||
|
@ -245,14 +245,16 @@
|
||||||
:opt-un [::share-id]))
|
:opt-un [::share-id]))
|
||||||
|
|
||||||
(sv/defmethod ::create-comment-thread
|
(sv/defmethod ::create-comment-thread
|
||||||
{::retry/max-retries 3
|
{::doc/added "1.15"
|
||||||
::retry/matches retry/conflict-db-insert?
|
|
||||||
::doc/added "1.15"
|
|
||||||
::webhooks/event? true}
|
::webhooks/event? true}
|
||||||
[{:keys [pool] :as cfg} {:keys [profile-id file-id share-id] :as params}]
|
[{:keys [pool] :as cfg} {:keys [profile-id file-id share-id] :as params}]
|
||||||
(db/with-atomic [conn pool]
|
(db/with-atomic [conn pool]
|
||||||
(files/check-comment-permissions! conn profile-id file-id share-id)
|
(files/check-comment-permissions! conn profile-id file-id share-id)
|
||||||
(create-comment-thread conn params)))
|
|
||||||
|
(rtry/with-retry {::rtry/when rtry/conflict-exception?
|
||||||
|
::rtry/max-retries 3
|
||||||
|
::rtry/label "create-comment-thread"}
|
||||||
|
(create-comment-thread conn params))))
|
||||||
|
|
||||||
(defn- retrieve-next-seqn
|
(defn- retrieve-next-seqn
|
||||||
[conn file-id]
|
[conn file-id]
|
||||||
|
|
Loading…
Add table
Reference in a new issue