Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #306 from dcanar9/master
Browse files Browse the repository at this point in the history
Uncommenting Line of code and changing logging
  • Loading branch information
nameisaravind authored Oct 6, 2022
2 parents 84dc828 + 717f265 commit 027c16e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>api</artifactId>
<packaging>jar</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<version>3.4.51</version>
<version>3.4.52</version>
<description>Hygieia Rest API Layer</description>
<url>https://github.com/Hygieia/api</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,22 @@ public ResponseEntity<String> cleanup(String collectorTypeString, String collect

// get collectorItems that have not been updated since the endDate given
List<CollectorItem> collectorItems = collectorItemRepository.findByCollectorIdAndLastUpdatedBefore(collector.get().getId(), endDate);
LOG.info(String.format("deleteDisconnectedItems :: Found %d collectorItems to verify", collectorItems.size()));
LOG.info(String.format("cleanup :: Found %d collectorItems to verify", collectorItems.size()));

// iterate through enabled items and check if they are connected to a dashboard
for (CollectorItem collectorItem : collectorItems) {
if (!hasComponent(collectorType, collectorItem.getId())) {

String loggingPrefix = String.format("findOldCollectorItems :: Removing (#%d of %d):: could not find a dashboard for the collectorItem with the following options:"
String loggingPrefix = String.format("cleanup :: Removing (#%d of %d):: could not find a dashboard for the collectorItem with the following options:"
,collectorItems.indexOf(collectorItem)+1, collectorItems.size());

logDeletedCollectorItem(collectorType, collectorItem, loggingPrefix);
// collectorItemRepository.delete(collectorItem.getId());
collectorItemRepository.delete(collectorItem.getId());
count++;
}
}

LOG.info(String.format("deleteDisconnectedItems :: Finished (duration=%s) :: collectorType=%s :: Found %d items with no corresponding dashboard.", System.currentTimeMillis() - startTime, collectorType.toString(), count));
LOG.info(String.format("cleanup :: Finished (duration=%s) :: collectorType=%s :: Found %d items with no corresponding dashboard.", System.currentTimeMillis() - startTime, collectorType.toString(), count));
return ResponseEntity.status(HttpStatus.OK).body(String.format("Successfully removed %d %s type collectorItems out of %d", count, collectorType.toString(), collectorItems.size()));
}

Expand Down

0 comments on commit 027c16e

Please sign in to comment.