Skip to content

Commit 7e3df55

Browse files
committed
Skip loading the user when finishing a compat session
1 parent b856c88 commit 7e3df55

File tree

1 file changed

+6
-9
lines changed
  • crates/handlers/src/admin/v1/compat_sessions

1 file changed

+6
-9
lines changed

crates/handlers/src/admin/v1/compat_sessions/finish.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,14 @@ pub async fn handler(
9999
return Err(RouteError::AlreadyFinished(id));
100100
}
101101

102-
// Load the user to schedule a device sync job
103-
let user = repo
104-
.user()
105-
.lookup(session.user_id)
106-
.await?
107-
.ok_or_else(|| RouteError::Internal("User not found for session".into()))?;
108-
109102
// Schedule a job to sync the devices of the user with the homeserver
110-
tracing::info!(user.id = %user.id, "Scheduling device sync job for user");
103+
tracing::info!(user.id = %session.user_id, "Scheduling device sync job for user");
111104
repo.queue_job()
112-
.schedule_job(&mut rng, &clock, SyncDevicesJob::new(&user))
105+
.schedule_job(
106+
&mut rng,
107+
&clock,
108+
SyncDevicesJob::new_for_id(session.user_id),
109+
)
113110
.await?;
114111

115112
// Finish the session

0 commit comments

Comments
 (0)