added @Lazy to PubSubRuleNodeExecutorProvider
This commit is contained in:
parent
fbec7aab25
commit
66b768a499
@ -323,6 +323,7 @@ public class ActorSystemContext {
|
|||||||
@Getter
|
@Getter
|
||||||
private NotificationExecutorService notificationExecutor;
|
private NotificationExecutorService notificationExecutor;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
@Autowired
|
@Autowired
|
||||||
@Getter
|
@Getter
|
||||||
private PubSubRuleNodeExecutorProvider pubSubRuleNodeExecutorProvider;
|
private PubSubRuleNodeExecutorProvider pubSubRuleNodeExecutorProvider;
|
||||||
|
|||||||
@ -16,15 +16,19 @@
|
|||||||
package org.thingsboard.server.service.executors;
|
package org.thingsboard.server.service.executors;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.thingsboard.common.util.ExecutorProvider;
|
import org.thingsboard.common.util.ExecutorProvider;
|
||||||
import org.thingsboard.common.util.ThingsBoardThreadFactory;
|
import org.thingsboard.common.util.ThingsBoardThreadFactory;
|
||||||
|
import org.thingsboard.server.queue.util.TbRuleEngineComponent;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.PreDestroy;
|
import javax.annotation.PreDestroy;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@TbRuleEngineComponent
|
||||||
@Component
|
@Component
|
||||||
public class PubSubRuleNodeExecutorProvider implements ExecutorProvider {
|
public class PubSubRuleNodeExecutorProvider implements ExecutorProvider {
|
||||||
|
|
||||||
@ -53,7 +57,7 @@ public class PubSubRuleNodeExecutorProvider implements ExecutorProvider {
|
|||||||
@PreDestroy
|
@PreDestroy
|
||||||
private void destroy() {
|
private void destroy() {
|
||||||
if (executor != null) {
|
if (executor != null) {
|
||||||
executor.shutdown();
|
executor.shutdownNow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,7 +54,7 @@ public class TbPubSubQueueExecutorProvider implements ExecutorProvider {
|
|||||||
@PreDestroy
|
@PreDestroy
|
||||||
private void destroy() {
|
private void destroy() {
|
||||||
if (executor != null) {
|
if (executor != null) {
|
||||||
executor.shutdown();
|
executor.shutdownNow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user