Browse Source

fix: 去掉调试痕迹

master
fajiao 2 years ago
parent
commit
5568a6a7c2
  1. 32
      Cis.Application/Core/Center/CameraDataCenter.cs

32
Cis.Application/Core/Center/CameraDataCenter.cs

@ -86,19 +86,13 @@ public class CameraDataCenter : ISingleton
/// </summary> /// </summary>
private async Task RefreshCameraPtzInfos() private async Task RefreshCameraPtzInfos()
{ {
try string[] cameraIpList = await _cache.HKeysAsync(CacheInfo.CameraIpCounts);
{ List<Task> tasks = new();
string[] cameraIpList = await _cache.HKeysAsync(CacheInfo.CameraIpCounts); foreach (string cameraIp in cameraIpList)
List<Task> tasks = new();
foreach (string cameraIp in cameraIpList)
{
tasks.Add(RefreshCameraPtzInfo(cameraIp));
}
await Task.WhenAny(Task.WhenAll(tasks), Task.Delay(_options.CameraPtz.Timeout));
}
catch (Exception e)
{ {
tasks.Add(RefreshCameraPtzInfo(cameraIp));
} }
await Task.WhenAny(Task.WhenAll(tasks), Task.Delay(_options.CameraPtz.Timeout));
} }
/// <summary> /// <summary>
@ -118,19 +112,13 @@ public class CameraDataCenter : ISingleton
/// </summary> /// </summary>
private async Task RefreshMarkSearchers() private async Task RefreshMarkSearchers()
{ {
try string[] cameraIdList = await _cache.HKeysAsync(CacheInfo.CameraId2Ip);
{ List<Task> tasks = new();
string[] cameraIdList = await _cache.HKeysAsync(CacheInfo.CameraId2Ip); foreach (string cameraId in cameraIdList)
List<Task> tasks = new();
foreach (string cameraId in cameraIdList)
{
tasks.Add(RefreshMarkSearcher(cameraId.ToLong()));
}
await Task.WhenAny(Task.WhenAll(tasks), Task.Delay(_options.CameraPtz.Timeout));
}
catch (Exception e)
{ {
tasks.Add(RefreshMarkSearcher(cameraId.ToLong()));
} }
await Task.WhenAny(Task.WhenAll(tasks), Task.Delay(_options.CameraPtz.Timeout));
} }
/// <summary> /// <summary>

Loading…
Cancel
Save