Bladeren bron

add 规则引擎集群

18339543638 4 jaren geleden
bovenliggende
commit
cf164fbfa7

+ 4 - 10
jetlinks-components/rule-engine-component/src/main/java/org/jetlinks/community/rule/engine/cluster/ClusterUniqueTask.java

@@ -157,11 +157,8 @@ class ClusterUniqueTask implements Task ,Serializable{
                 context.setJob(old);
                 throw e;
             }
-        }).concatWith(Mono.fromRunnable(
-            ()->
-                this.clusterManager.getTopic(this.operationTopic)
-                    .publish(Mono.just(OperationMessage.of(TaskOperation.JOB,Collections.singletonList(job),this.currentSeverId)))
-                    .then()))
+        }).concatWith(this.clusterManager.getTopic(this.operationTopic)
+                    .publish(Mono.just(OperationMessage.of(TaskOperation.JOB,Collections.singletonList(job),this.currentSeverId))))
             .then();
 
     }
@@ -306,11 +303,8 @@ class ClusterUniqueTask implements Task ,Serializable{
     @Override
     public Mono<Void> reload() {
         return operation(OperationMessage.of(TaskOperation.RELOAD,currentSeverId))
-            .concatWith(Mono.fromRunnable(
-                ()->
-                    this.clusterManager.getTopic(this.operationTopic)
-                        .publish(Mono.just(OperationMessage.of(TaskOperation.RELOAD,null,this.currentSeverId)))
-                        .then()))
+            .concatWith(this.clusterManager.getTopic(this.operationTopic)
+                        .publish(Mono.just(OperationMessage.of(TaskOperation.RELOAD,null,this.currentSeverId))).then())
             .then();
     }