tabish121 commented on code in PR #6093:
URL: https://github.com/apache/activemq-artemis/pull/6093#discussion_r2578794932
##########
artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTStateManager.java:
##########
@@ -112,8 +113,12 @@ public void scanSessions() {
MQTTSessionState state = entry.getValue();
logger.debug("Inspecting session: {}", state);
int sessionExpiryInterval = state.getClientSessionExpiryInterval();
- if (!state.isAttached() && sessionExpiryInterval > 0 &&
state.getDisconnectedTime() + (sessionExpiryInterval * 1000) <
System.currentTimeMillis()) {
- toRemove.add(entry.getKey());
+ if (!state.isAttached()) {
+ if (sessionExpiryInterval == 0) {
Review Comment:
This seems like it could be flattened into one if since it could be an Or on
the next condition either its zero or its a positive value and trips the time
limt
##########
artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTStateManager.java:
##########
@@ -112,8 +113,12 @@ public void scanSessions() {
MQTTSessionState state = entry.getValue();
logger.debug("Inspecting session: {}", state);
int sessionExpiryInterval = state.getClientSessionExpiryInterval();
- if (!state.isAttached() && sessionExpiryInterval > 0 &&
state.getDisconnectedTime() + (sessionExpiryInterval * 1000) <
System.currentTimeMillis()) {
- toRemove.add(entry.getKey());
+ if (!state.isAttached()) {
+ if (sessionExpiryInterval == 0) {
Review Comment:
This seems like it could be flattened into one if since it could be an Or on
the next condition either its zero or its a positive value and trips the time
limit
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact