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