mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 00:40:30 -05:00
Add retry mechanism to rstore.
That allows does not close all streams on first 1024 errors.
This commit is contained in:
parent
a70ebcab44
commit
124366cbce
1 changed files with 3 additions and 1 deletions
|
@ -90,7 +90,7 @@
|
||||||
"A default error handler."
|
"A default error handler."
|
||||||
[e]
|
[e]
|
||||||
(println "Unexpected error: " e)
|
(println "Unexpected error: " e)
|
||||||
(rx/empty))
|
(rx/throw e))
|
||||||
|
|
||||||
(defn init
|
(defn init
|
||||||
"Initializes the stream event loop and
|
"Initializes the stream event loop and
|
||||||
|
@ -102,6 +102,7 @@
|
||||||
state-s (->> update-s
|
state-s (->> update-s
|
||||||
(rx/scan #(-apply-update %2 %1) state)
|
(rx/scan #(-apply-update %2 %1) state)
|
||||||
(rx/catch on-error)
|
(rx/catch on-error)
|
||||||
|
(rx/retry 1024)
|
||||||
(rx/share))]
|
(rx/share))]
|
||||||
|
|
||||||
;; Process event sources: combine with the latest model and the result will be
|
;; Process event sources: combine with the latest model and the result will be
|
||||||
|
@ -110,6 +111,7 @@
|
||||||
(rx/with-latest-from vector state-s $)
|
(rx/with-latest-from vector state-s $)
|
||||||
(rx/flat-map (fn [[event model]] (-apply-watch event model stream)) $)
|
(rx/flat-map (fn [[event model]] (-apply-watch event model stream)) $)
|
||||||
(rx/catch on-error $)
|
(rx/catch on-error $)
|
||||||
|
(rx/retry 1024 $)
|
||||||
(rx/on-value $ emit!))
|
(rx/on-value $ emit!))
|
||||||
|
|
||||||
;; Process effects: combine with the latest model to process the new effect
|
;; Process effects: combine with the latest model to process the new effect
|
||||||
|
|
Loading…
Reference in a new issue