Skip to content

Commit

Permalink
Merge branch 'bikeshedder:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
smf8 authored Aug 29, 2024
2 parents 279d501 + 6d3514f commit 261d26c
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04
# Include lld linker to improve build times either by using environment variable
# RUSTFLAGS="-C link-arg=-fuse-ld=lld" or with Cargo's configuration file (i.e see .cargo/config.toml).
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install clang lld libsqlite3-dev libmariadb-dev-compat libmariadb-dev libpq-dev pkg-config \
&& apt-get -y install clang lld libsqlite3-dev libmariadb-dev-compat libmariadb-dev libpq-dev pkg-config gh \
&& apt-get autoremove -y && apt-get clean -y

USER vscode

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.75 --no-modify-path -y
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.79 --no-modify-path -y

RUN /home/vscode/.cargo/bin/cargo install cargo-release
RUN /home/vscode/.cargo/bin/cargo install --locked cargo-outdated
RUN /home/vscode/.cargo/bin/cargo install --locked cargo-outdated
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ jobs:
- { crate: deadpool-runtime, msrv: '1.75.0' }
- { crate: deadpool-sync, msrv: '1.75.0' }
- { crate: deadpool, msrv: '1.75.0' }
- { crate: deadpool-diesel, msrv: '1.78.0' }
# Disable Diesel MSRV check as it keeps failing for no obvious reason.
#- { crate: deadpool-diesel, msrv: '1.78.0' }
- { crate: deadpool-lapin, msrv: '1.75.0' }
- { crate: deadpool-postgres, msrv: '1.75.0' }
- { crate: deadpool-redis, msrv: '1.75.0' }
Expand Down
5 changes: 4 additions & 1 deletion redis/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.16.0] - 2024-08-05

- Update `redis` dependency to version `0.26`

## [0.15.1] - 2024-05-04
Expand Down Expand Up @@ -159,7 +161,8 @@ Release of 0.6 and 0.7 with the following feature backported:
- First release

<!-- next-url -->
[Unreleased]: https://github.com/bikeshedder/deadpool/compare/deadpool-redis-v0.15.1...HEAD
[Unreleased]: https://github.com/bikeshedder/deadpool/compare/deadpool-redis-v0.16.0...HEAD
[0.16.0]: https://github.com/bikeshedder/deadpool/compare/deadpool-redis-v0.15.1...deadpool-redis-v0.16.0
[0.15.1]: https://github.com/bikeshedder/deadpool/compare/deadpool-redis-v0.15.0...deadpool-redis-v0.15.1
[0.15.0]: https://github.com/bikeshedder/deadpool/compare/deadpool-redis-v0.14.0...deadpool-redis-v0.15.0
[0.14.0]: https://github.com/bikeshedder/deadpool/compare/deadpool-redis-v0.13.0...deadpool-redis-v0.14.0
Expand Down
2 changes: 1 addition & 1 deletion redis/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "deadpool-redis"
version = "0.15.1"
version = "0.16.0"
edition = "2021"
rust-version = "1.75"
authors = [
Expand Down
41 changes: 26 additions & 15 deletions redis/tests/redis_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,28 +94,39 @@ async fn test_aborted_command() {
async fn test_recycled() {
let pool = create_pool();

let client_id = {
let mut conn = pool.get().await.unwrap();
let connection_name = "unique_connection_name";

let connection_details_1 = {
let mut conn = pool.get().await.unwrap();
cmd("CLIENT")
.arg("ID")
.query_async::<i64>(&mut conn)
.arg("SETNAME")
.arg(connection_name)
.query_async::<()>(&mut conn)
.await
.unwrap()
.unwrap();

let current_name: Option<String> = cmd("CLIENT")
.arg("GETNAME")
.query_async(&mut conn)
.await
.unwrap();

current_name
};

{
let connection_details_2 = {
let mut conn = pool.get().await.unwrap();

let new_client_id = cmd("CLIENT")
.arg("ID")
.query_async::<i64>(&mut conn)
let current_name: Option<String> = cmd("CLIENT")
.arg("GETNAME")
.query_async(&mut conn)
.await
.unwrap();

assert_eq!(
client_id, new_client_id,
"the redis connection was not recycled"
);
}
current_name
};

assert_eq!(
connection_details_1, connection_details_2,
"The Redis connection was not recycled: different connection name"
);
}

0 comments on commit 261d26c

Please sign in to comment.