mirror of https://github.com/status-im/timbre.git
Make Carmine appender resistant to unexpected thaw errors
This commit is contained in:
parent
4a5c4ccce4
commit
87af0d40cc
|
@ -1,3 +1,7 @@
|
|||
## Pending major release
|
||||
* Make Carmine appender resistant to unexpected log entry thaw errors.
|
||||
|
||||
|
||||
## v3.0.0 / 2014-Jan-30
|
||||
|
||||
Major update, non-breaking though users with custom appenders are encouraged to view the _Changes_ section below. This version polishes up the codebase and general design. Tightened up a few aspects of how appenders and appender middleware work. Added a serializing Carmine appender (I use something similar in prod most of the time). Also finally added facilities for ad hoc (non-atom) logging configuration.
|
||||
|
|
|
@ -107,13 +107,18 @@
|
|||
:hash entry-hash}))
|
||||
[]))
|
||||
|
||||
entries-hash ; [{_} {_} ...]
|
||||
entries-hash ; [{_}-or-ex {_}-or-ex ...]
|
||||
(when-let [hashes (seq (mapv :hash entries-zset))]
|
||||
(if-not (next hashes)
|
||||
[(car/wcar conn (apply car/hget k-hash hashes))] ; Careful!
|
||||
(car/wcar conn (apply car/hmget k-hash hashes))))]
|
||||
(car/wcar conn :as-pipeline (apply car/hget k-hash hashes)) ; Careful!
|
||||
(car/wcar conn (apply car/hmget k-hash hashes))))]
|
||||
|
||||
(mapv (fn [m1 m2] (-> (merge m1 m2) (dissoc :hash)))
|
||||
(mapv (fn [m1 m2-or-ex]
|
||||
(if (instance? Exception m2-or-ex)
|
||||
;; Should be rare but can happen (e.g. due to faulty Nippy
|
||||
;; extensions or inconsistently-unserializable args):
|
||||
(-> (assoc m1 :entry-ex m2-or-ex) (dissoc :hash))
|
||||
(-> (merge m1 m2-or-ex) (dissoc :hash))))
|
||||
entries-zset entries-hash)))
|
||||
|
||||
;;;; Dev/tests
|
||||
|
|
Loading…
Reference in New Issue