Skip to content

Commit

Permalink
retry after deletion (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 authored Dec 12, 2023
1 parent 0cc0e2f commit 2f774a4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scalardb/src/scalardb/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,21 @@
(loop [retries RETRIES]
(when (zero? retries)
(throw (ex-info "Failed to set up tables" {:schema schema})))
(let [result (try
(let [schema (cheshire/generate-string schema)
result (try
(SchemaLoader/load properties
(cheshire/generate-string schema)
schema
options
true)
:success
(catch Exception e
(warn (.getMessage e))
(try
(SchemaLoader/unload properties
schema
true)
(catch Exception e
(warn (.getMessage e))))
:fail))]
(when (= result :fail)
(recur (dec retries))))))))
Expand Down

0 comments on commit 2f774a4

Please sign in to comment.