Skip to content

Commit

Permalink
Catch different redis exception (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdemare authored Aug 23, 2024
1 parent 5439748 commit 1b535ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/nl/surf/eduhub_rio_mapper/worker.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
[nl.surf.eduhub-rio-mapper.utils.redis :as redis]
[taoensso.carmine :as car])
(:import java.io.EOFException
java.util.UUID))
java.util.UUID
[java.net UnknownHostException]))

(defn- prefix-key
[{:keys [redis-key-prefix]
Expand Down Expand Up @@ -308,6 +309,10 @@
(reset! worker-busy true)
(worker-loop config stop-atom)
::stopped
(catch UnknownHostException ex
(if (ex-util/backtrace-matches-regex? ex #"carmine")
(RuntimeException. "Redis is not available")
ex))
(catch EOFException ex
(if (ex-util/backtrace-matches-regex? ex #"carmine")
(RuntimeException. "Redis is not available")
Expand Down

0 comments on commit 1b535ee

Please sign in to comment.