1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +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

@@ -121,9 +121,8 @@ impl<'c> BrowserSessionRepository for PgBrowserSessionRepository<'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) };