session manager: open session on executor thread
This avoids blocking the main thread on startup during the http call
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user