Code review minor misc fixes
This commit is contained in:
		
							parent
							
								
									ce085ea9a0
								
							
						
					
					
						commit
						4e1cbf5c1e
					
				@ -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);
 | 
			
		||||
 | 
			
		||||
@ -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")
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user