Skip to content

Commit

Permalink
fix: redis flushing on shutdown
Browse files Browse the repository at this point in the history
Signed-off-by: nabil salah <[email protected]>
  • Loading branch information
Nabil-Salah committed Dec 12, 2024
1 parent 755699b commit 4271cb4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ where
select! {
_ = tokio::signal::ctrl_c() => {
log::info!("shutting down listener gracefully");
if let Err(err) = self.cache.flush().await {
log::error!("failed to flush redis cache {}", err);
}else {
log::info!("Succesful flush of redis cache");
}
break;
},
result = self.handle_events() => {
Expand Down

0 comments on commit 4271cb4

Please sign in to comment.