mirror of
https://github.com/penpot/penpot.git
synced 2025-06-02 22:01:39 +02:00
✨ Fix msbus/redis logged errors on restarting (repl).
This commit is contained in:
parent
6557792a98
commit
610afc7702
1 changed files with 10 additions and 2 deletions
|
@ -21,6 +21,7 @@
|
||||||
java.time.Duration
|
java.time.Duration
|
||||||
io.lettuce.core.RedisClient
|
io.lettuce.core.RedisClient
|
||||||
io.lettuce.core.RedisURI
|
io.lettuce.core.RedisURI
|
||||||
|
io.lettuce.core.api.StatefulConnection
|
||||||
io.lettuce.core.api.StatefulRedisConnection
|
io.lettuce.core.api.StatefulRedisConnection
|
||||||
io.lettuce.core.api.async.RedisAsyncCommands
|
io.lettuce.core.api.async.RedisAsyncCommands
|
||||||
io.lettuce.core.codec.ByteArrayCodec
|
io.lettuce.core.codec.ByteArrayCodec
|
||||||
|
@ -130,6 +131,7 @@
|
||||||
|
|
||||||
;; --- REDIS BACKEND IMPL
|
;; --- REDIS BACKEND IMPL
|
||||||
|
|
||||||
|
(declare impl-redis-open?)
|
||||||
(declare impl-redis-pub)
|
(declare impl-redis-pub)
|
||||||
(declare impl-redis-sub)
|
(declare impl-redis-sub)
|
||||||
(declare impl-redis-unsub)
|
(declare impl-redis-unsub)
|
||||||
|
@ -162,7 +164,8 @@
|
||||||
(a/go-loop []
|
(a/go-loop []
|
||||||
(when-let [val (a/<! pub-ch)]
|
(when-let [val (a/<! pub-ch)]
|
||||||
(let [result (a/<! (impl-redis-pub rac val))]
|
(let [result (a/<! (impl-redis-pub rac val))]
|
||||||
(when (ex/exception? result)
|
(when (and (impl-redis-open? pub-conn)
|
||||||
|
(ex/exception? result))
|
||||||
(l/error :cause result
|
(l/error :cause result
|
||||||
:hint "unexpected error on publish message to redis")))
|
:hint "unexpected error on publish message to redis")))
|
||||||
(recur)))))
|
(recur)))))
|
||||||
|
@ -214,7 +217,8 @@
|
||||||
(let [result (a/<!! (impl-redis-unsub rac topic))]
|
(let [result (a/<!! (impl-redis-unsub rac topic))]
|
||||||
(l/trace :action "close subscription"
|
(l/trace :action "close subscription"
|
||||||
:topic topic)
|
:topic topic)
|
||||||
(when (ex/exception? result)
|
(when (and (impl-redis-open? sub-conn)
|
||||||
|
(ex/exception? result))
|
||||||
(l/error :cause result
|
(l/error :cause result
|
||||||
:hint "unexpected exception on unsubscribing"
|
:hint "unexpected exception on unsubscribing"
|
||||||
:topic topic))))
|
:topic topic))))
|
||||||
|
@ -265,6 +269,10 @@
|
||||||
(run! a/close!)))))))))
|
(run! a/close!)))))))))
|
||||||
|
|
||||||
|
|
||||||
|
(defn- impl-redis-open?
|
||||||
|
[^StatefulConnection conn]
|
||||||
|
(.isOpen conn))
|
||||||
|
|
||||||
(defn- impl-redis-pub
|
(defn- impl-redis-pub
|
||||||
[^RedisAsyncCommands rac {:keys [topic message]}]
|
[^RedisAsyncCommands rac {:keys [topic message]}]
|
||||||
(let [message (blob/encode message)
|
(let [message (blob/encode message)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue