Update Rust crate redis to 0.32.0#358
Conversation
2306ac6 to
4ed81f2
Compare
833d111 to
1294ce1
Compare
95aee90 to
a054f76
Compare
a9aae2e to
f46ee27
Compare
2dc4c18 to
76ef18a
Compare
76ef18a to
6bbf683
Compare
32b6c19 to
20b8874
Compare
20b8874 to
d617e3a
Compare
d617e3a to
b7dce29
Compare
897fa48 to
5c694e5
Compare
7fa038b to
ce064b7
Compare
0f6a605 to
7386db9
Compare
7386db9 to
65fc60f
Compare
770685c to
3f3754a
Compare
77f2dd5 to
33c8385
Compare
33c8385 to
b31dd05
Compare
389f234 to
917cb11
Compare
5368698 to
2ffb4e8
Compare
2ffb4e8 to
76bacf1
Compare
0aed12b to
c060327
Compare
3fd3f52 to
84b1a61
Compare
4544646 to
5274908
Compare
ea7d88e to
76e5ab5
Compare
6d85fc1 to
233e1e7
Compare
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe pull request updates the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Cargo.toml`:
- Line 12: The code still calls Client::get_tokio_connection() which was removed
in redis 0.32.x; update the call in src/main.rs (where get_tokio_connection is
used) to either await client.get_multiplexed_tokio_connection().await for a
multiplexed connection or use client.get_connection_manager().await to get an
auto-reconnecting ConnectionManager (the Cargo.toml already enables the
connection-manager feature); keep using the AsyncCommands::{get, set_ex} APIs
as-is with the new connection type and adjust any type annotations or imports to
use redis::aio::MultiplexedConnection or redis::aio::ConnectionManager
accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d621de04-c46a-45d7-9614-bbdf160c58a5
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
Cargo.toml
| actix-web = "4.5.1" | ||
| lazy_static = "1.4.0" | ||
| redis = { version = "0.29.0", default-features = false, features = ["tokio-comp", "connection-manager"] } | ||
| redis = { version = "0.32.0", default-features = false, features = ["tokio-comp", "connection-manager"] } |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
For redis crate 0.32.x, is redis::Client::get_tokio_connection()still available/supported? What is the recommended async connection method replacement, and doAsyncCommands::getandset_exremain available withtokio-comp+connection-manager features?
💡 Result:
-
No: in
redis0.32.x (e.g. 0.32.7),redis::Clientdoes not exposeget_tokio_connection(); the async client APIs are centered around multiplexed connections and (optionally) the connection manager (see theClientmethod list: it hasget_multiplexed_*+get_connection_manager, but noget_tokio_connection). [1] -
Recommended async replacement (Tokio):
- Use a multiplexed async connection:
client.get_multiplexed_async_connection().await(runtime-agnostic entrypoint), or the Tokio-specificget_multiplexed_tokio_connection().await. [1]
- If you want auto-reconnect, use:
client.get_connection_manager().await(and enable theconnection-managerfeature). [2]
- Use a multiplexed async connection:
-
Do
AsyncCommands::getandset_exstill exist / work withtokio-comp+connection-manager?- Yes:
AsyncCommandsinredis0.32.x still providesgetandset_ex. [3] - And both
MultiplexedConnectionandConnectionManagersupportAsyncCommands(blanket impl viaConnectionLike + Send + Sync), so you can callcon.get(...).await/con.set_ex(...).awaiton either. [4]
- Yes:
Sources
redis0.32.7Clientdocs (method list includesget_multiplexed_*,get_connection_manager, etc.). (docs.rs)redis0.32.7 crate docs on async + recommendingConnectionManagerfor automatic reconnections. (docs.rs)redis0.32.7AsyncCommandsdocs showinggetandset_exprovided methods. (docs.rs)redis0.32.7MultiplexedConnection/ConnectionManagerdocs showingAsyncCommandsblanket implementations. (docs.rs)
Citations:
- 1: https://docs.rs/redis/0.32.7/redis/struct.Client.html
- 2: https://docs.rs/crate/redis/0.32.7
- 3: https://docs.rs/redis/0.32.7/redis/trait.AsyncCommands.html
- 4: https://docs.rs/redis/0.32.7/redis/aio/struct.MultiplexedConnection.html
🏁 Script executed:
#!/bin/bash
# Read-only scan for potentially impacted redis call sites after the 0.32 upgrade.
rg -n -C3 'get_tokio_connection\s*\(|AsyncCommands|set_ex\s*\(|\bget::<'Repository: TeamPiped/region-restriction-checker
Length of output: 776
Fix redis 0.32.x breaking change: get_tokio_connection() no longer exists.
The upgrade from redis 0.29.x to 0.32.x introduces a breaking API change. The Client::get_tokio_connection() method used on line 359 of src/main.rs does not exist in 0.32.x. Replace it with either:
client.get_multiplexed_tokio_connection().awaitfor a multiplexed connection, orclient.get_connection_manager().awaitfor auto-reconnect (requires theconnection-managerfeature, which is already enabled).
The AsyncCommands::{get, set_ex} methods remain available and compatible with both approaches.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Cargo.toml` at line 12, The code still calls Client::get_tokio_connection()
which was removed in redis 0.32.x; update the call in src/main.rs (where
get_tokio_connection is used) to either await
client.get_multiplexed_tokio_connection().await for a multiplexed connection or
use client.get_connection_manager().await to get an auto-reconnecting
ConnectionManager (the Cargo.toml already enables the connection-manager
feature); keep using the AsyncCommands::{get, set_ex} APIs as-is with the new
connection type and adjust any type annotations or imports to use
redis::aio::MultiplexedConnection or redis::aio::ConnectionManager accordingly.
This PR contains the following updates:
0.29.0→0.32.0Release Notes
redis-rs/redis-rs (redis)
v0.32.7Compare Source
What's Changed
v0.32.6Compare Source
0.32.6 (2025-09-26)
Changes
hexpire_atcommand measurement unit by (#1793 by @chrxn1c)v0.32.5Compare Source
What's Changed
Changes & Bug fixes
Documentation & CI improvements
v0.32.4Compare Source
What's Changed
Changes & Bug fixes
New Contributors
Full Changelog: redis-rs/redis-rs@redis-0.32.3...redis-0.32.4
v0.32.3Compare Source
0.32.3 (2025-06-30)
Changes & Bug fixes
Documentation & CI improvements
New Contributors
Full Changelog: redis-rs/redis-rs@redis-0.32.2...redis-0.32.3
v0.32.2Compare Source
Changes & Bug fixes
v0.32.1Compare Source
What's Changed
New Contributors
Full Changelog: redis-rs/redis-rs@redis-0.32.0...redis-0.32.1
v0.32.0Compare Source
Changes & Bug fixes
v0.31.0Compare Source
Changes & Bug fixes
ringdependency fromrustls. (#1632 by @nihohit)reserve_space_for_argstake aIntoIterator(#1622 by @Kriskras99)v0.30.0Compare Source
Changes & Bug fixes
Documentation & CI improvements
make docs(#1607 by @somechris)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.
Summary by CodeRabbit