1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

Batch finish browser sessions

This commit is contained in:
Quentin Gliech
2024-07-16 11:53:04 +02:00
parent 04b96b87b8
commit dcaf65e6e7
3 changed files with 119 additions and 10 deletions

View File

@ -148,6 +148,24 @@ pub trait BrowserSessionRepository: Send + Sync {
user_session: BrowserSession,
) -> Result<BrowserSession, Self::Error>;
/// Mark all the [`BrowserSession`] matching the given filter as finished
///
/// Returns the number of sessions affected
///
/// # Parameters
///
/// * `clock`: The clock used to generate timestamps
/// * `filter`: The filter parameters
///
/// # Errors
///
/// Returns [`Self::Error`] if the underlying repository fails
async fn finish_bulk(
&mut self,
clock: &dyn Clock,
filter: BrowserSessionFilter<'_>,
) -> Result<usize, Self::Error>;
/// List [`BrowserSession`] with the given filter and pagination
///
/// # Parameters
@ -262,6 +280,12 @@ repository_impl!(BrowserSessionRepository:
user_session: BrowserSession,
) -> Result<BrowserSession, Self::Error>;
async fn finish_bulk(
&mut self,
clock: &dyn Clock,
filter: BrowserSessionFilter<'_>,
) -> Result<usize, Self::Error>;
async fn list(
&mut self,
filter: BrowserSessionFilter<'_>,