Skip to content

Commit 2db0034

Browse files
committed
feat:support auth.
1 parent eb34cc1 commit 2db0034

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

polaris-plugins/polaris-plugins-connector/connector-composite/src/main/java/com/tencent/polaris/plugins/connector/composite/CompositeServiceUpdateTask.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ public void execute() {
111111
isServiceUpdateTaskExecuted = true;
112112
entry.getValue().setStatus(ServiceUpdateTaskConstant.Status.READY, ServiceUpdateTaskConstant.Status.RUNNING);
113113
entry.getValue().execute(this);
114+
} else if (alreadyExecute(entry.getKey(), entry.getValue())) {
115+
// for ExpirePendingTaskCleaner
116+
isServiceUpdateTaskExecuted = true;
114117
}
115118
}
116-
// TODO 全部规则实现完后改成StringUtils.equals(mainConnectorType, SERVER_CONNECTOR_CONSUL)
117119
if (ifMainConnectorTypeSet && isServiceUpdateTaskExecuted
118120
&& (StringUtils.equals(mainConnectorType, SERVER_CONNECTOR_GRPC)
119121
|| (serviceEventKey.getEventType().equals(EventType.INSTANCE)
@@ -417,6 +419,14 @@ private boolean canExecute(String connectorType, ServiceUpdateTask serviceUpdate
417419
return canConnectorExecute && canTaskExecute;
418420
}
419421

422+
private boolean alreadyExecute(String connectorType, ServiceUpdateTask serviceUpdateTask) {
423+
boolean canConnectorExecute = StringUtils.equalsIgnoreCase(mainConnectorType, connectorType)
424+
|| serviceEventKey.getEventType().equals(EventType.INSTANCE)
425+
|| serviceEventKey.getEventType().equals(EventType.SERVICE);
426+
boolean alreadyTaskExecute = serviceUpdateTask.getTaskStatus() == Status.RUNNING;
427+
return canConnectorExecute && alreadyTaskExecute;
428+
}
429+
420430
public boolean notifyServerEventWithRevisionChecking(ServerEvent serverEvent, String revision) {
421431
if (serverEvent.getValue() instanceof DiscoverResponse) {
422432
if (StringUtils.equals(revision, instanceListMeta.getLastRevision())) {

0 commit comments

Comments
 (0)