Do the site initialization and login in parallel and wrapped in try
catch block
This commit is contained in:
parent
698b5a5d62
commit
65ea3e1adb
|
@ -54,6 +54,7 @@ import org.slf4j.LoggerFactory;
|
|||
import com.google.common.base.Objects;
|
||||
|
||||
import ctbrec.Config;
|
||||
import ctbrec.GlobalThreadPool;
|
||||
import ctbrec.NotLoggedInExcetion;
|
||||
import ctbrec.Version;
|
||||
import ctbrec.event.EventBusHolder;
|
||||
|
@ -110,8 +111,14 @@ public class HttpServer {
|
|||
recorder = new NextGenLocalRecorder(config, sites);
|
||||
for (Site site : sites) {
|
||||
if (site.isEnabled()) {
|
||||
site.init();
|
||||
safeLogin(site);
|
||||
GlobalThreadPool.submit(() -> {
|
||||
try {
|
||||
site.init();
|
||||
safeLogin(site);
|
||||
} catch (IOException e) {
|
||||
LOG.error("Error while initializing site {}", site.getName(), e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
onlineMonitor = new OnlineMonitor(recorder, config);
|
||||
|
|
Loading…
Reference in New Issue