Commit 8e08ddcbca2f183c62dd5c07dc8d97dea81c8a41

Authored by Volodymyr Babak
1 parent b0bfdfff

Return fast if entity is edge

... ... @@ -147,6 +147,7 @@ import org.thingsboard.server.service.telemetry.TelemetrySubscriptionService;
147 147 import javax.mail.MessagingException;
148 148 import javax.servlet.http.HttpServletResponse;
149 149 import java.util.ArrayList;
  150 +import java.util.Collections;
150 151 import java.util.List;
151 152 import java.util.Map;
152 153 import java.util.Optional;
... ... @@ -1086,6 +1087,9 @@ public abstract class BaseController {
1086 1087 if (!edgesEnabled) {
1087 1088 return null;
1088 1089 }
  1090 + if (EntityType.EDGE.equals(entityId.getEntityType())) {
  1091 + return Collections.singletonList(new EdgeId(entityId.getId()));
  1092 + }
1089 1093 List<EdgeId> result = new ArrayList<>();
1090 1094 PageLink pageLink = new PageLink(DEFAULT_PAGE_SIZE);
1091 1095 PageData<EdgeId> pageData;
... ...