diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-09-27 23:03:46 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-09-28 01:00:12 -0400 |
| commit | 60b711c844f8624348d5d1dac3a625532a8e2a82 (patch) | |
| tree | a667cfa3833046425a87ec03c700d6124af70e4e /src/events/routes.rs | |
| parent | 08c3a6e77a3f61ffc9643a5e1f840df9078d0b36 (diff) | |
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.
Diffstat (limited to 'src/events/routes.rs')
| -rw-r--r-- | src/events/routes.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/events/routes.rs b/src/events/routes.rs index 3f70dcd..89c942c 100644 --- a/src/events/routes.rs +++ b/src/events/routes.rs @@ -13,7 +13,7 @@ use super::{ extract::LastEventId, types::{self, ResumePoint}, }; -use crate::{app::App, clock::RequestedAt, error::Internal, repo::login::Login}; +use crate::{app::App, error::Internal, repo::login::Login}; #[cfg(test)] mod test; @@ -24,7 +24,6 @@ pub fn router() -> Router<App> { async fn events( State(app): State<App>, - RequestedAt(subscribed_at): RequestedAt, _: Login, // requires auth, but doesn't actually care who you are last_event_id: Option<LastEventId<ResumePoint>>, ) -> Result<Events<impl Stream<Item = types::ResumableEvent> + std::fmt::Debug>, Internal> { @@ -32,7 +31,7 @@ async fn events( .map(LastEventId::into_inner) .unwrap_or_default(); - let stream = app.events().subscribe(&subscribed_at, resume_at).await?; + let stream = app.events().subscribe(resume_at).await?; Ok(Events(stream)) } |
