Skip to content

Commit

Permalink
fix npe when enable the testWhileIdle parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ylinzhu committed Dec 15, 2023
1 parent 26dd566 commit 5f2b5da
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ public void okResponse(byte[] ok, AbstractService service) {
}
return;
}

heartbeatTimeout.cancel();
listener.onHeartbeatSuccess((PooledConnection) service.getConnection());
if (!heartbeatTimeout.isExpired()) {
heartbeatTimeout.cancel();
listener.onHeartbeatSuccess((PooledConnection) service.getConnection());
}
}

@Override
Expand Down

0 comments on commit 5f2b5da

Please sign in to comment.