fix: 修复示波器与数码管无法关闭的问题
This commit is contained in:
@@ -70,7 +70,7 @@ public class DigitalTubesHub : Hub<IDigitalTubesReceiver>, IDigitalTubesHub
|
|||||||
private readonly IHubContext<DigitalTubesHub, IDigitalTubesReceiver> _hubContext;
|
private readonly IHubContext<DigitalTubesHub, IDigitalTubesReceiver> _hubContext;
|
||||||
private readonly Database.UserManager _userManager = new();
|
private readonly Database.UserManager _userManager = new();
|
||||||
|
|
||||||
private ConcurrentDictionary<string, DigitalTubesScanTaskInfo> _scanTasks = new();
|
private static ConcurrentDictionary<string, DigitalTubesScanTaskInfo> _scanTasks = new();
|
||||||
|
|
||||||
public DigitalTubesHub(IHubContext<DigitalTubesHub, IDigitalTubesReceiver> hubContext)
|
public DigitalTubesHub(IHubContext<DigitalTubesHub, IDigitalTubesReceiver> hubContext)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public class OscilloscopeHub : Hub<IOscilloscopeReceiver>, IOscilloscopeHub
|
|||||||
private readonly IHubContext<OscilloscopeHub, IOscilloscopeReceiver> _hubContext;
|
private readonly IHubContext<OscilloscopeHub, IOscilloscopeReceiver> _hubContext;
|
||||||
private readonly Database.UserManager _userManager = new();
|
private readonly Database.UserManager _userManager = new();
|
||||||
|
|
||||||
private ConcurrentDictionary<string, OscilloscopeScanTaskInfo> _scanTasks = new();
|
private static ConcurrentDictionary<string, OscilloscopeScanTaskInfo> _scanTasks = new();
|
||||||
|
|
||||||
public OscilloscopeHub(IHubContext<OscilloscopeHub, IOscilloscopeReceiver> hubContext)
|
public OscilloscopeHub(IHubContext<OscilloscopeHub, IOscilloscopeReceiver> hubContext)
|
||||||
{
|
{
|
||||||
@@ -192,9 +192,7 @@ public class OscilloscopeHub : Hub<IOscilloscopeReceiver>, IOscilloscopeHub
|
|||||||
var scanTaskInfo = new OscilloscopeScanTaskInfo(client);
|
var scanTaskInfo = new OscilloscopeScanTaskInfo(client);
|
||||||
scanTaskInfo.ScanTask = ScanTask(scanTaskInfo, Context.ConnectionId);
|
scanTaskInfo.ScanTask = ScanTask(scanTaskInfo, Context.ConnectionId);
|
||||||
|
|
||||||
_scanTasks[key] = scanTaskInfo;
|
return _scanTasks.TryAdd(key, scanTaskInfo);
|
||||||
|
|
||||||
return result.Value;
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user