session manager: open session on executor thread

This avoids blocking the main thread on startup during the http call
This commit is contained in:
Adam
2022-04-08 10:58:13 -04:00
parent dc009bd7af
commit f54b7ffc44

View File

@@ -62,15 +62,18 @@ public class ClientSessionManager
public void start() public void start()
{ {
try executorService.execute(() ->
{ {
sessionId = sessionClient.open(); try
log.debug("Opened session {}", sessionId); {
} sessionId = sessionClient.open();
catch (IOException ex) log.debug("Opened session {}", sessionId);
{ }
log.warn("error opening session", ex); catch (IOException ex)
} {
log.warn("error opening session", ex);
}
});
scheduledFuture = executorService.scheduleWithFixedDelay(RunnableExceptionLogger.wrap(this::ping), 1, 10, TimeUnit.MINUTES); scheduledFuture = executorService.scheduleWithFixedDelay(RunnableExceptionLogger.wrap(this::ping), 1, 10, TimeUnit.MINUTES);
} }