|
|
|
@ -41,6 +41,7 @@ import org.thingsboard.server.service.executors.NotificationExecutorService; |
|
|
|
import org.thingsboard.server.service.partition.AbstractPartitionBasedService; |
|
|
|
|
|
|
|
import javax.annotation.PostConstruct; |
|
|
|
import javax.annotation.PreDestroy; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.List; |
|
|
|
@ -66,6 +67,7 @@ public class DefaultNotificationSchedulerService extends AbstractPartitionBasedS |
|
|
|
|
|
|
|
private final Map<NotificationRequestId, ScheduledRequestMetadata> scheduledNotificationRequests = new ConcurrentHashMap<>(); |
|
|
|
|
|
|
|
@Override |
|
|
|
@PostConstruct |
|
|
|
public void init() { |
|
|
|
super.init(); |
|
|
|
@ -167,6 +169,13 @@ public class DefaultNotificationSchedulerService extends AbstractPartitionBasedS |
|
|
|
return "notifications-scheduler"; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@PreDestroy |
|
|
|
public void stop() { |
|
|
|
super.stop(); |
|
|
|
scheduler.shutdownNow(); |
|
|
|
} |
|
|
|
|
|
|
|
@Data |
|
|
|
private static class ScheduledRequestMetadata { |
|
|
|
private final TenantId tenantId; |
|
|
|
|