Skip to content

Commit

Permalink
Give up push/retry-later in debug mode, eventually
Browse files Browse the repository at this point in the history
This avoids super noisy logging when you aren't running the
push server locally (the common case).
  • Loading branch information
dhleong committed Sep 29, 2019
1 parent b8317ba commit 449a5a3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/cljs/wish/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -869,11 +869,16 @@

; base of 2s delay
2000)]
(log "Retry push connection after " new-delay)
{:db (assoc db ::push/retry-delay new-delay)
:dispatch-later-keyed [{:ms new-delay
:key :push/retry-later
:dispatch [:push/check]}]})))
(if (and goog.DEBUG
(= new-delay last-delay))
(log "DEBUG ONLY: Giving up push-retry")

(do
(log "Retry push connection after " new-delay)
{:db (assoc db ::push/retry-delay new-delay)
:dispatch-later-keyed [{:ms new-delay
:key :push/retry-later
:dispatch [:push/check]}]})))))

(reg-event-fx
::push/session-created
Expand Down

0 comments on commit 449a5a3

Please sign in to comment.