mirror of https://github.com/zlatinb/muwire
prevent RejectedExecutionExceptions on shutdown
parent
fcd3414e02
commit
43987be463
|
@ -62,7 +62,7 @@ class ConnectionEstablisher {
|
|||
void stop() {
|
||||
timer.cancel()
|
||||
executor.shutdownNow()
|
||||
closer.shutdown()
|
||||
closer.shutdownNow()
|
||||
}
|
||||
|
||||
private void connectIfNeeded() {
|
||||
|
@ -123,10 +123,12 @@ class ConnectionEstablisher {
|
|||
}
|
||||
|
||||
private void fail(Endpoint endpoint) {
|
||||
closer.execute {
|
||||
endpoint.close()
|
||||
eventBus.publish(new ConnectionEvent(endpoint: endpoint, incoming: false, leaf: false, status: ConnectionAttemptStatus.FAILED))
|
||||
} as Runnable
|
||||
if (!closer.isShutdown()) {
|
||||
closer.execute {
|
||||
endpoint.close()
|
||||
eventBus.publish(new ConnectionEvent(endpoint: endpoint, incoming: false, leaf: false, status: ConnectionAttemptStatus.FAILED))
|
||||
} as Runnable
|
||||
}
|
||||
}
|
||||
|
||||
private void readK(Endpoint e) {
|
||||
|
|
Loading…
Reference in New Issue