Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/mosquito/redis_backend.cr
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ module Mosquito
def average(key : String) : Int32
stats = redis.lrange key, 0, -1
return 0_i32 if stats.empty?
stats.map(&.as(String).to_i32).sum // stats.size
sum = stats.sum(0_i64) { |s| s.as(String).to_i64 }
(sum // stats.size).to_i32
end

class Queue < Backend::Queue
Expand Down
Loading