           (when success
             (.lrem redis-connection working-queue-key-name 0 item-str)
 
-            (.incr redis-connection counter-queue-name)
+            (inc-counter context counter-queue-name)
 
             (when keep-done
               (.rpush redis-connection done-queue-key-name (into-array [item-str])))))

  (:require [baleen.context :as bcontext]
            [baleen.time :as btime]
            [baleen.redis :as redis]))

(defn enqueue-with-time
  "Enqueue an input as a JSON blob.

    (let [queue-key-name (str (bcontext/get-app-name context) "-" queue-name)
          log-key-name (str (bcontext/get-app-name context) "-" queue-name "-" (btime/format-ymd event-time))
          counter-key-name (str (bcontext/get-app-name context) "-" queue-name "-count")
          ]
      
      ; Increment counter.
      (inc-counter context counter-key-name)

      ; Push to start of queue.
      (.lpush redis-connection queue-key-name (into-array [json-blob]))
