Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
only retry SQLExceptions
  • Loading branch information
ibarrick committed Jan 21, 2020
commit 1bbd9f9c03a79f35213ba5372477fdca403b49ec
2 changes: 2 additions & 0 deletions src/yesql/generate.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[yesql.statement-parser :refer [tokenize]]
[safely.core :refer [safely]])
(:import yesql.types.Query)
(:import java.sql.SQLException)
(:import java.lang.IllegalArgumentException))

(def in-list-parameter?
Expand Down Expand Up @@ -145,6 +146,7 @@
call-options)
:on-error
:max-retries 5
:retryable-error? #(isa? (class %) SQLException)
:retry-delay [:random-exp-backoff :base 50 :+/- 0.5])]
(cond (and (= insert-handler jdbc-fn) (:hooks query-options) (:after-insert @(:hooks query-options)))
((:after-insert @(:hooks query-options)) ret args statement (assoc call-options :uuid uuid))
Expand Down