Skip to content

Commit

Permalink
changed connection status updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ck-c8y committed Mar 17, 2024
1 parent 3946b02 commit 0b30b49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ public void submitConnect() {
if (connectTask == null || connectTask.isDone()) {
connectTask = cachedThreadPool.submit(() -> connect());
}
connectorStatus.updateStatus(ConnectorStatus.CONNECTING, true);
sendConnectorLifecycle();
}

public void submitDisconnect() {
Expand All @@ -171,8 +169,6 @@ public void submitDisconnect() {
if (connectTask == null || connectTask.isDone()) {
connectTask = cachedThreadPool.submit(() -> disconnect());
}
connectorStatus.updateStatus(ConnectorStatus.DISCONNECTING, true);
sendConnectorLifecycle();
}

public void submitHousekeeping() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ public ConnectorSpecification getSpecification() {

@Override
public void connect() {
connectorStatus.updateStatus(ConnectorStatus.CONNECTING, true);
sendConnectorLifecycle();
log.info("Tenant {} - Establishing the MQTT connection now - phase I: (isConnected:shouldConnect) ({}:{})",
tenant, isConnected(),
shouldConnect());
Expand Down Expand Up @@ -371,6 +373,8 @@ public boolean isConnected() {

@Override
public void disconnect() {
connectorStatus.updateStatus(ConnectorStatus.DISCONNECTING, true);
sendConnectorLifecycle();
log.info("Tenant {} - Disconnecting from MQTT broker: {}", tenant,
(mqttClient == null ? null : mqttClient.getConfig().getServerHost()));

Expand Down

0 comments on commit 0b30b49

Please sign in to comment.