1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-07 17:03:01 +03:00

Batch finish compatibility sessions

This commit is contained in:
Quentin Gliech
2024-07-15 22:57:24 +02:00
parent fa32387ca5
commit f8d12cc305
3 changed files with 94 additions and 2 deletions

View File

@@ -209,6 +209,24 @@ pub trait CompatSessionRepository: Send + Sync {
compat_session: CompatSession,
) -> Result<CompatSession, Self::Error>;
/// Mark all the [`CompatSession`] matching the given filter as finished
///
/// Returns the number of sessions affected
///
/// # Parameters
///
/// * `clock`: The clock used to generate timestamps
/// * `filter`: The filter to apply
///
/// # Errors
///
/// Returns [`Self::Error`] if the underlying repository fails
async fn finish_bulk(
&mut self,
clock: &dyn Clock,
filter: CompatSessionFilter<'_>,
) -> Result<usize, Self::Error>;
/// List [`CompatSession`] with the given filter and pagination
///
/// Returns a page of compat sessions, with the associated SSO logins if any
@@ -289,6 +307,12 @@ repository_impl!(CompatSessionRepository:
compat_session: CompatSession,
) -> Result<CompatSession, Self::Error>;
async fn finish_bulk(
&mut self,
clock: &dyn Clock,
filter: CompatSessionFilter<'_>,
) -> Result<usize, Self::Error>;
async fn list(
&mut self,
filter: CompatSessionFilter<'_>,