Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.

Commit

Permalink
#77 Zoombied Ethereum Pump Instance
Browse files Browse the repository at this point in the history
  • Loading branch information
arturalbov authored and hleb-albau committed Apr 2, 2018
1 parent 34e2c93 commit aa3ddf1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import io.micrometer.core.instrument.DistributionSummary
import io.micrometer.core.instrument.MeterRegistry
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.ConfigurableApplicationContext
import org.springframework.context.annotation.DependsOn
import org.springframework.stereotype.Component
import java.util.concurrent.TimeUnit
Expand All @@ -29,7 +30,8 @@ class ChainPump<T : BlockBundle>(
private val lastPumpedBundlesProvider: LastPumpedBundlesProvider<T>,
private val monitoring: MeterRegistry,
@Value("\${$START_BLOCK_NUMBER:$START_BLOCK_NUMBER_DEFAULT}")
private val startBlockNumber: Long
private val startBlockNumber: Long,
private val applicationContext: ConfigurableApplicationContext
) {

fun startPump() {
Expand Down Expand Up @@ -65,7 +67,8 @@ class ChainPump<T : BlockBundle>(
{ error ->
if (error !is ChainReindexationException) {
log.error("Error during processing stream", error)
//close context
log.info("Closing application context...")
applicationContext.close()
}
}
)
Expand Down

0 comments on commit aa3ddf1

Please sign in to comment.