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()
{
try
executorService.execute(() ->
{
sessionId = sessionClient.open();
log.debug("Opened session {}", sessionId);
}
catch (IOException ex)
{
log.warn("error opening session", ex);
}
try
{
sessionId = sessionClient.open();
log.debug("Opened session {}", sessionId);
}
catch (IOException ex)
{
log.warn("error opening session", ex);
}
});
scheduledFuture = executorService.scheduleWithFixedDelay(RunnableExceptionLogger.wrap(this::ping), 1, 10, TimeUnit.MINUTES);
}