提升Catalog查询回复处理速度

pull/1669/head
648540858 2024-10-26 23:28:41 +08:00
parent 22fcab375f
commit 16b1bf6819
1 changed files with 16 additions and 0 deletions

View File

@ -257,4 +257,20 @@ public class CatalogDataManager implements CommandLineRunner {
catalogData.setErrorMsg(errorMsg);
catalogData.setTime(Instant.now());
}
public int size(String deviceId) {
CatalogData catalogData = dataMap.get(deviceId);
if (catalogData == null) {
return 0;
}
return catalogData.getRedisKeysForChannel().size();
}
public int sumNum(String deviceId) {
CatalogData catalogData = dataMap.get(deviceId);
if (catalogData == null) {
return 0;
}
return catalogData.getTotal();
}
}