Add more log

This commit is contained in:
Mygod
2019-01-18 11:59:11 +08:00
parent a583d6c143
commit 37337fd2ef

View File

@@ -251,12 +251,14 @@ class Routing(val downstream: String, ownerAddress: InterfaceAddress? = null) :
fun commit() { fun commit() {
transaction.commit() transaction.commit()
Timber.i("Started routing for $downstream")
FallbackUpstreamMonitor.registerCallback(fallbackUpstream) FallbackUpstreamMonitor.registerCallback(fallbackUpstream)
UpstreamMonitor.registerCallback(upstream) UpstreamMonitor.registerCallback(upstream)
IpNeighbourMonitor.registerCallback(this) IpNeighbourMonitor.registerCallback(this)
} }
fun revert() { fun revert() {
stop() stop()
Timber.i("Stopped routing for $downstream")
TrafficRecorder.update() // record stats before exiting to prevent stats losing TrafficRecorder.update() // record stats before exiting to prevent stats losing
clients.values.forEach { it.close() } clients.values.forEach { it.close() }
fallbackUpstream.subrouting?.transaction?.revert() fallbackUpstream.subrouting?.transaction?.revert()