[backend/api-shared] Don't dispose DbContext prematurely in streaming connection handlers
This commit is contained in:
parent
bba0ea79cd
commit
9233e43b81
2 changed files with 2 additions and 2 deletions
|
@ -370,7 +370,7 @@ public sealed class WebSocketConnection(
|
|||
{
|
||||
if (note.Reply == null) return false;
|
||||
if (note.User.Id == Token.UserId) return false;
|
||||
await using var db = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
|
||||
var db = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
|
||||
return await db.NoteThreadMutings.AnyAsync(p => p.UserId == Token.UserId && p.ThreadId == note.ThreadId);
|
||||
}
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ public sealed class StreamingConnectionAggregate : IDisposable
|
|||
{
|
||||
if (note.Reply == null) return false;
|
||||
if (note.User.Id == _userId) return false;
|
||||
await using var db = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
|
||||
var db = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
|
||||
return await db.NoteThreadMutings.AnyAsync(p => p.UserId == _userId && p.ThreadId == note.ThreadId);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue