Close database connection before sleeping
This commit is contained in:
parent
8e773d92c1
commit
38ade4e985
@ -52,11 +52,11 @@ public class MessageSendLogStore implements AutoCloseable {
|
|||||||
while (true) {
|
while (true) {
|
||||||
try (final var connection = database.getConnection()) {
|
try (final var connection = database.getConnection()) {
|
||||||
deleteOutdatedEntries(connection);
|
deleteOutdatedEntries(connection);
|
||||||
Thread.sleep(interval);
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
logger.warn("Deleting outdated entries failed");
|
logger.warn("Deleting outdated entries failed");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Thread.sleep(interval);
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
logger.debug("Stopping msl cleanup thread");
|
logger.debug("Stopping msl cleanup thread");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user