Skip to content

Commit

Permalink
Cancel periodic priority update on delete connection
Browse files Browse the repository at this point in the history
Signed-off-by: Yannic Klem <yannic.klem@bosch.io>
  • Loading branch information
Yannic92 committed Aug 30, 2021
1 parent 7fb60f5 commit 00fb15e
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,12 @@ protected Receive matchAnyWhenDeleted() {
.orElse(super.matchAnyWhenDeleted());
}

@Override
protected void becomeDeletedHandler() {
this.cancelPeriodicPriorityUpdate();
super.becomeDeletedHandler();
}

/**
* Route search commands according to subscription ID prefix. This is necessary so that for connections with
* client count > 1, all commands related to 1 search session are routed to the same client actor. This is achieved
Expand Down Expand Up @@ -857,6 +863,10 @@ private void startUpdatePriorityPeriodically(final Duration priorityUpdateInterv
priorityUpdateInterval);
}

private void cancelPeriodicPriorityUpdate() {
timers().cancel(Control.TRIGGER_UPDATE_PRIORITY);
}

private void respondWithEmptyLogs(final RetrieveConnectionLogs command, final ActorRef origin) {
log.debug("ClientActor not started, responding with empty connection logs.");
final RetrieveConnectionLogsResponse logsResponse = RetrieveConnectionLogsResponse.of(
Expand Down

0 comments on commit 00fb15e

Please sign in to comment.