Code review minor misc fixes

This commit is contained in:
Volodymyr Babak 2022-01-19 12:50:22 +02:00
parent ce085ea9a0
commit 4e1cbf5c1e
2 changed files with 6 additions and 3 deletions

View File

@ -28,6 +28,9 @@ import org.thingsboard.server.queue.util.TbCoreComponent;
@Service
public class EdgeEventsCleanUpService extends AbstractCleanUpService {
public static final String RANDOM_DELAY_INTERVAL_MS_EXPRESSION =
"#{T(org.apache.commons.lang3.RandomUtils).nextLong(0, ${sql.ttl.edge_events.execution_interval_ms})}";
@Value("${sql.ttl.edge_events.edge_events_ttl}")
private long ttl;
@ -41,7 +44,7 @@ public class EdgeEventsCleanUpService extends AbstractCleanUpService {
this.edgeEventService = edgeEventService;
}
@Scheduled(initialDelayString = "${sql.ttl.edge_events.execution_interval_ms}", fixedDelayString = "${sql.ttl.edge_events.execution_interval_ms}")
@Scheduled(initialDelayString = RANDOM_DELAY_INTERVAL_MS_EXPRESSION, fixedDelayString = "${sql.ttl.edge_events.execution_interval_ms}")
public void cleanUp() {
if (ttlTaskExecutionEnabled && isSystemTenantPartitionMine()) {
edgeEventService.cleanupEvents(ttl);

View File

@ -32,8 +32,8 @@ public class EdgeId extends UUIDBased implements EntityId {
super(id);
}
public static EdgeId fromString(String integrationId) {
return new EdgeId(UUID.fromString(integrationId));
public static EdgeId fromString(String edgeId) {
return new EdgeId(UUID.fromString(edgeId));
}
@ApiModelProperty(position = 2, required = true, value = "string", example = "EDGE", allowableValues = "EDGE")