sureshanaparti commented on code in PR #6825:
URL: https://github.com/apache/cloudstack/pull/6825#discussion_r994024218
##########
usage/src/main/java/com/cloud/usage/UsageSanityChecker.java:
##########
@@ -69,48 +69,51 @@ protected boolean checkItemCountByPstmt(CheckCase
checkCase) throws SQLException
/*
* Check for item usage records which are created after it is removed
*/
- try (PreparedStatement pstmt =
conn.prepareStatement(checkCase.sqlTemplate)) {
- if(checkCase.checkId) {
- pstmt.setInt(1, lastId);
- pstmt.setInt(2, maxId);
- }
- try(ResultSet rs = pstmt.executeQuery();) {
- if (rs.next() && (rs.getInt(1) > 0)) {
- errors.append(String.format("Error: Found %s %s\n",
rs.getInt(1), checkCase.itemName));
- checkOk = false;
+ try (PreparedStatement pstmt =
conn.prepareStatement(checkCase.getSqlTemplate())) {
+ if(checkCase.isCheckId()) {
Review Comment:
```suggestion
if (checkCase.isCheckId()) {
```
--
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]