Skip to content

Commit 64ec09f

Browse files
author
Bastien Guerry
committed
src/subscribe-dsfr.clj: Warn every 10 new subscribers
1 parent 0d4a912 commit 64ec09f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/subscribe-dsfr.clj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,12 @@
672672
:debug {:status (:status response)
673673
:body (:body response)}}))))
674674

675+
(def subscription-count (atom 0))
676+
(defn warn-new-subscription! []
677+
(let [new-count (swap! subscription-count inc)]
678+
(when (zero? (mod new-count 10))
679+
(log/info (format "%d new subscriptions" new-count)))))
680+
675681
(defn subscribe-to-mailgun [email]
676682
(log/info "Attempting to subscribe email:" email)
677683

@@ -693,6 +699,7 @@
693699

694700
(< (:status response) 300)
695701
(do
702+
(warn-new-subscription!)
696703
(log/info "Successfully subscribed email:" email)
697704
{:success true})
698705

0 commit comments

Comments
 (0)