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