Skip to content

Commit

Permalink
fix: when server is down, request needs to be handled properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
shedfreez committed Dec 11, 2024
1 parent 2d65ad3 commit 6ad8c3d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ public boolean needUpdate() {
@Override
public void execute() {
boolean isServiceUpdateTaskExecuted = false;
int subTaskSize = subServiceUpdateTaskMap.size();
for (Map.Entry<String, ServiceUpdateTask> entry : subServiceUpdateTaskMap.entrySet()) {
if (canExecute(entry.getKey(), entry.getValue())) {
// TODO: check multi connector
if (subTaskSize == 1 || canExecute(entry.getKey(), entry.getValue())) {
isServiceUpdateTaskExecuted = true;
entry.getValue().setStatus(ServiceUpdateTaskConstant.Status.READY, ServiceUpdateTaskConstant.Status.RUNNING);
entry.getValue().execute(this);
Expand All @@ -126,6 +128,7 @@ public void execute() {
|| serviceEventKey.getEventType().equals(EventType.BLOCK_ALLOW_RULE)))) {
return;
}

boolean svcDeleted = this.notifyServerEvent(
new ServerEvent(serviceEventKey, DiscoverResponse.newBuilder().build(), null));
if (!svcDeleted) {
Expand Down

0 comments on commit 6ad8c3d

Please sign in to comment.