Skip to content

Commit

Permalink
fix(chirp): write message tail when history is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterPtato committed Jul 19, 2024
1 parent b293113 commit c0cd3cf
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions lib/chirp/client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,30 +799,30 @@ impl Client {

// Automatically expire
pipe.expire(&history_key, ttl as usize).ignore();
}

let perf = self.perf().clone();
let mut conn = self.redis_chirp_ephemeral.clone();
let spawn_res = join_set
.build_task()
.name("chirp_client::message_write_tail")
.spawn(
async move {
let span = perf.start(M::PERF_LABEL_WRITE_TAIL).await;
match pipe.query_async::<_, ()>(&mut conn).await {
Ok(_) => {
tracing::debug!("write to redis tail succeeded");
}
Err(err) => {
tracing::error!(?err, "failed to write to redis tail");
}
let perf = self.perf().clone();
let mut conn = self.redis_chirp_ephemeral.clone();
let spawn_res = join_set
.build_task()
.name("chirp_client::message_write_tail")
.spawn(
async move {
let span = perf.start(M::PERF_LABEL_WRITE_TAIL).await;
match pipe.query_async::<_, ()>(&mut conn).await {
Ok(_) => {
tracing::debug!("write to redis tail succeeded");
}
Err(err) => {
tracing::error!(?err, "failed to write to redis tail");
}
span.end();
}
.in_current_span(),
);
if let Err(err) = spawn_res {
tracing::error!(?err, "failed to spawn message_write_tail task");
}
span.end();
}
.in_current_span(),
);
if let Err(err) = spawn_res {
tracing::error!(?err, "failed to spawn message_write_tail task");
}
}
}
Expand Down

0 comments on commit c0cd3cf

Please sign in to comment.