Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated backwards compatibility of docker commands #42

Merged
Show file tree
Hide file tree
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
Empty file modified redis/cluster-entrypoint.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion redis/cluster.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ WORKDIR /redis
COPY cluster.conf .
RUN chown redis:redis /redis/cluster.conf
EXPOSE 6379
COPY --chmod=755 cluster-entrypoint.sh .
COPY cluster-entrypoint.sh .
ENTRYPOINT ["/redis/cluster-entrypoint.sh"]
2 changes: 1 addition & 1 deletion redis/docker_down.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
call set_host_ip.cmd
docker compose down
docker-compose down
2 changes: 1 addition & 1 deletion redis/docker_down.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
./set_host_ip.sh
docker compose down
docker-compose down
2 changes: 1 addition & 1 deletion redis/docker_up.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
call set_host_ip.cmd
docker compose up -d
docker-compose up -d
2 changes: 1 addition & 1 deletion redis/docker_up.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sh ./set_host_ip.sh
docker compose up -d
docker-compose up -d
Empty file modified redis/sentinel-entrypoint.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion redis/sentinel.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ WORKDIR /redis
COPY sentinel.conf .
RUN chown redis:redis /redis/sentinel.conf
EXPOSE 26379
COPY --chmod=755 sentinel-entrypoint.sh .
COPY sentinel-entrypoint.sh .
ENTRYPOINT ["/redis/sentinel-entrypoint.sh"]
Empty file modified redis/set_host_ip.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ impl Client {
/// Create a new transaction
#[inline]
pub fn create_transaction(&self) -> Transaction {
Transaction::new(self)
Transaction::new(self.clone())
}

/// Create a new pipeline
Expand Down
52 changes: 26 additions & 26 deletions src/client/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ use crate::{
use std::{fmt, marker::PhantomData};

/// Represents an on-going [`transaction`](https://redis.io/docs/manual/transactions/) on a specific client instance.
pub struct Transaction<'a> {
client: &'a Client,
pub struct Transaction {
client: Client,
commands: Vec<Command>,
forget_flags: Vec<bool>,
retry_on_error: Option<bool>,
}

impl<'a> Transaction<'a> {
pub(crate) fn new(client: &'a Client) -> Self {
impl Transaction {
pub(crate) fn new(client: Client) -> Self {
Self {
client,
commands: vec![cmd("MULTI")],
Expand Down Expand Up @@ -262,7 +262,7 @@ where
}
}

impl<'a, 'b, R: Response> BatchPreparedCommand for PreparedCommand<'a, &'a mut Transaction<'b>, R> {
impl<'a, R: Response> BatchPreparedCommand for PreparedCommand<'a, &'a mut Transaction, R> {
/// Queue a command into the transaction.
fn queue(self) {
self.executor.queue(self.command)
Expand All @@ -274,42 +274,42 @@ impl<'a, 'b, R: Response> BatchPreparedCommand for PreparedCommand<'a, &'a mut T
}
}

impl<'a, 'b> BitmapCommands<'a> for &'a mut Transaction<'b> {}
impl<'a> BitmapCommands<'a> for &'a mut Transaction {}
#[cfg_attr(docsrs, doc(cfg(feature = "redis-bloom")))]
#[cfg(feature = "redis-bloom")]
impl<'a, 'b> BloomCommands<'a> for &'a mut Transaction<'b> {}
impl<'a> BloomCommands<'a> for &'a mut Transaction {}
#[cfg_attr(docsrs, doc(cfg(feature = "redis-bloom")))]
#[cfg(feature = "redis-bloom")]
impl<'a, 'b> CountMinSketchCommands<'a> for &'a mut Transaction<'b> {}
impl<'a> CountMinSketchCommands<'a> for &'a mut Transaction {}
#[cfg_attr(docsrs, doc(cfg(feature = "redis-bloom")))]
#[cfg(feature = "redis-bloom")]
impl<'a, 'b> CuckooCommands<'a> for &'a mut Transaction<'b> {}
impl<'a, 'b> GenericCommands<'a> for &'a mut Transaction<'b> {}
impl<'a, 'b> GeoCommands<'a> for &'a mut Transaction<'b> {}
impl<'a> CuckooCommands<'a> for &'a mut Transaction {}
impl<'a> GenericCommands<'a> for &'a mut Transaction {}
impl<'a> GeoCommands<'a> for &'a mut Transaction {}
#[cfg_attr(docsrs, doc(cfg(feature = "redis-graph")))]
#[cfg(feature = "redis-graph")]
impl<'a, 'b> GraphCommands<'a> for &'a mut Transaction<'b> {}
impl<'a, 'b> HashCommands<'a> for &'a mut Transaction<'b> {}
impl<'a, 'b> HyperLogLogCommands<'a> for &'a mut Transaction<'b> {}
impl<'a> GraphCommands<'a> for &'a mut Transaction {}
impl<'a> HashCommands<'a> for &'a mut Transaction {}
impl<'a> HyperLogLogCommands<'a> for &'a mut Transaction {}
#[cfg_attr(docsrs, doc(cfg(feature = "redis-json")))]
#[cfg(feature = "redis-json")]
impl<'a, 'b> JsonCommands<'a> for &'a mut Transaction<'b> {}
impl<'a, 'b> ListCommands<'a> for &'a mut Transaction<'b> {}
impl<'a> JsonCommands<'a> for &'a mut Transaction {}
impl<'a> ListCommands<'a> for &'a mut Transaction {}
#[cfg_attr(docsrs, doc(cfg(feature = "redis-search")))]
#[cfg(feature = "redis-search")]
impl<'a, 'b> SearchCommands<'a> for &'a mut Transaction<'b> {}
impl<'a, 'b> SetCommands<'a> for &'a mut Transaction<'b> {}
impl<'a, 'b> ScriptingCommands<'a> for &'a mut Transaction<'b> {}
impl<'a, 'b> ServerCommands<'a> for &'a mut Transaction<'b> {}
impl<'a, 'b> SortedSetCommands<'a> for &'a mut Transaction<'b> {}
impl<'a, 'b> StreamCommands<'a> for &'a mut Transaction<'b> {}
impl<'a, 'b> StringCommands<'a> for &'a mut Transaction<'b> {}
impl<'a> SearchCommands<'a> for &'a mut Transaction {}
impl<'a> SetCommands<'a> for &'a mut Transaction {}
impl<'a> ScriptingCommands<'a> for &'a mut Transaction {}
impl<'a> ServerCommands<'a> for &'a mut Transaction {}
impl<'a> SortedSetCommands<'a> for &'a mut Transaction {}
impl<'a> StreamCommands<'a> for &'a mut Transaction {}
impl<'a> StringCommands<'a> for &'a mut Transaction {}
#[cfg_attr(docsrs, doc(cfg(feature = "redis-bloom")))]
#[cfg(feature = "redis-bloom")]
impl<'a, 'b> TDigestCommands<'a> for &'a mut Transaction<'b> {}
impl<'a> TDigestCommands<'a> for &'a mut Transaction {}
#[cfg_attr(docsrs, doc(cfg(feature = "redis-time-series")))]
#[cfg(feature = "redis-time-series")]
impl<'a, 'b> TimeSeriesCommands<'a> for &'a mut Transaction<'b> {}
impl<'a> TimeSeriesCommands<'a> for &'a mut Transaction {}
#[cfg_attr(docsrs, doc(cfg(feature = "redis-bloom")))]
#[cfg(feature = "redis-bloom")]
impl<'a, 'b> TopKCommands<'a> for &'a mut Transaction<'b> {}
impl<'a> TopKCommands<'a> for &'a mut Transaction {}
Loading