mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 00:16:16 +00:00
Minor cleanup from PR review
This commit is contained in:
parent
1a437d8686
commit
30a364c417
@ -310,13 +310,14 @@ public class ServicesHealthMonitor {
|
||||
timingMapCopy = new HashMap<>(timingInfoMap);
|
||||
timingInfoMap.clear();
|
||||
}
|
||||
logger.log(Level.INFO, "Writing health monitor metrics to database");
|
||||
|
||||
// Check if there's anything to report (right now we only have the timing map)
|
||||
if(timingMapCopy.keySet().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
logger.log(Level.INFO, "Writing health monitor metrics to database");
|
||||
|
||||
// Write to the database
|
||||
CoordinationService.Lock lock = getSharedDbLock();
|
||||
if(lock == null) {
|
||||
@ -380,7 +381,6 @@ public class ServicesHealthMonitor {
|
||||
try (Connection connection = DriverManager.getConnection("jdbc:postgresql://" + db.getHost() + ":" + db.getPort() + "/postgres", db.getUserName(), db.getPassword()); //NON-NLS
|
||||
Statement statement = connection.createStatement();) {
|
||||
String createCommand = "SELECT 1 AS result FROM pg_database WHERE datname='" + DATABASE_NAME + "'";
|
||||
System.out.println(" query: " + createCommand);
|
||||
rs = statement.executeQuery(createCommand);
|
||||
if(rs.next()) {
|
||||
logger.log(Level.INFO, "Existing Services Health Monitor database found");
|
||||
|
Loading…
x
Reference in New Issue
Block a user