From 60b711c844f8624348d5d1dac3a625532a8e2a82 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Fri, 27 Sep 2024 23:03:46 -0400 Subject: Delete expired messages out of band. Trying to reliably do expiry mid-request was causing some anomalies: * Creating a channel with a dup name would fail, then succeed after listing channels. It was very hard to reason about which operations needed to trigger expiry, to fix this "correctly," so now expiry runs on every request. --- src/cli.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/cli.rs') diff --git a/src/cli.rs b/src/cli.rs index a6d752c..472d68f 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -72,6 +72,10 @@ impl Args { let app = App::from(pool); let app = routers() + .route_layer(middleware::from_fn_with_state( + app.clone(), + events::expire::middleware, + )) .route_layer(middleware::from_fn(clock::middleware)) .with_state(app); -- cgit v1.2.3