summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@action.fairlystable.org>2020-10-24 23:49:48 -0700
committerJoe Rayhawk <jrayhawk@action.fairlystable.org>2020-10-24 23:49:48 -0700
commit2cf41f470cbc4318c8d2ef72e7fcaa29277e6356 (patch)
treee2fde53df7413a652ba2f697099e3ee3a86f265a
parent97c900005f549a04787516f67ecfa60890c7b550 (diff)
downloadtwitch-irc.tar.gz
twitch-irc.zip
Update to match Crystal's newer Time APIirc
-rw-r--r--src/twitch/rate_limiter.cr4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/twitch/rate_limiter.cr b/src/twitch/rate_limiter.cr
index 929dbc0..7049337 100644
--- a/src/twitch/rate_limiter.cr
+++ b/src/twitch/rate_limiter.cr
@@ -7,7 +7,7 @@ class RateLimiter(T)
@bucket = {} of K => Deque(Time)
end
- def rate_limited?(key : K, rate_limit_time = Time.now)
+ def rate_limited?(key : K, rate_limit_time = Time.utc)
queue = @bucket[key]?
unless queue
@@ -30,7 +30,7 @@ class RateLimiter(T)
false
end
- def clean_queue(queue, rate_limit_time = Time.now)
+ def clean_queue(queue, rate_limit_time = Time.utc)
while queue[0] < rate_limit_time
queue.shift
end