stefanwille / crystal-redis

Full featured Redis client for Crystal
MIT License
381 stars 61 forks source link

Fix `timeout` type for >= 0.3.0 `pool` compatibility #133

Closed joshrickard closed 1 year ago

joshrickard commented 1 year ago

The scheduled specs appear to be broken at the moment due to some changes in the pool shard with version 0.3.0 which ultimately addressed some concurrency issues as reported in https://github.com/stefanwille/crystal-redis/pull/132.

Here is an example build failure along with the error messages:

expected argument 'timeout' to 'ConnectionPool(Redis).new' to be Time::Span, not Float64

In pool 0.3.0 the float timeout initializer was deprecated in favor of a Time::Span. I would not have thought this would break the build since it is only deprecated (and not removed), but maybe I'm not understanding how deprecations work in Crystal.

Regardless, this PR changes the float value to a Time::Span to conform with the new initializer. I also marked the pool shard as dependent on >= 0.3.0. Let me know if that is undesirable.