1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-12-03 22:51:11 +03:00

mas-storage-pg: use fetch_optional instead of fetch_one and matching on the error

This commit is contained in:
Quentin Gliech
2023-07-20 17:13:15 +02:00
parent 802cf142fd
commit b60121346f
17 changed files with 63 additions and 122 deletions

View File

@@ -205,9 +205,8 @@ impl<'c> CompatSessionRepository for PgCompatSessionRepository<'c> {
Uuid::from(id),
)
.traced()
.fetch_one(&mut *self.conn)
.await
.to_option()?;
.fetch_optional(&mut *self.conn)
.await?;
let Some(res) = res else { return Ok(None) };