Open TomerG2 opened 10 months ago
Trying to use this library and I'm getting the following exception: nth not supported on this type (This only occurs when using redis)
nth not supported on this type
Here's my code:
(ns app.clj_rate_limit_example (:require [clj-rate-limiter.core :as r])) (def redis {:pool {} :spec {:uri "redis://:*****@localhost:6379"}}) (def limiter (r/create (r/rate-limiter-factory :redis :redis redis :namespace "APIs" :interval 1000 :max-in-interval 100))) (def limiter-mem (r/create (r/rate-limiter-factory :memory :interval 1000 :max-in-interval 100))) (defn -main [] (println "Check rate limit: Mem") (println (r/allow? limiter-mem "key1")) (println "Done - check rate limit: Mem") (println "Check rate limit: Redis") (println (r/permit? limiter "key1")) (println "Done - check rate limit: Redis"))
This is the output:
Check rate limit: Mem true Done - check rate limit: Mem Check rate limit: Redis Execution error (UnsupportedOperationException) at clj-rate-limiter.core/match-exec-ret (core.clj:145). nth not supported on this type: ExceptionInfo
I'd appreciate any pointers/help!
Update:
--requirepass
NOAUTH Authentication Required
Trying to use this library and I'm getting the following exception:
nth not supported on this type
(This only occurs when using redis)Here's my code:
This is the output:
I'd appreciate any pointers/help!