fix: 修复数据库与SignalR无法连接的问题
This commit is contained in:
@@ -95,8 +95,6 @@ public class HttpVideoStreamService : BackgroundService
|
||||
{
|
||||
private static readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
private HttpListener? _httpListener;
|
||||
private readonly int _serverPort = 4321;
|
||||
|
||||
@@ -109,11 +107,6 @@ public class HttpVideoStreamService : BackgroundService
|
||||
private readonly object _usbCameraLock = new object();
|
||||
#endif
|
||||
|
||||
public HttpVideoStreamService(IServiceProvider serviceProvider)
|
||||
{
|
||||
_serviceProvider = serviceProvider;
|
||||
}
|
||||
|
||||
private Optional<VideoStreamClient> TryGetClient(string boardId)
|
||||
{
|
||||
if (_clientDict.TryGetValue(boardId, out var client))
|
||||
@@ -131,8 +124,7 @@ public class HttpVideoStreamService : BackgroundService
|
||||
return client;
|
||||
}
|
||||
|
||||
using var scope = _serviceProvider.CreateScope();
|
||||
var userManager = scope.ServiceProvider.GetRequiredService<Database.UserManager>();
|
||||
var userManager = new Database.UserManager();
|
||||
|
||||
var boardRet = userManager.GetBoardByID(Guid.Parse(boardId));
|
||||
if (!boardRet.IsSuccessful || !boardRet.Value.HasValue)
|
||||
|
||||
Reference in New Issue
Block a user