mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-03 18:47:38 +01:00
Remove rescan specific threadpool (#5746)
This commit is contained in:
parent
835c98e5b9
commit
471c063532
2 changed files with 2 additions and 14 deletions
|
@ -97,16 +97,6 @@ case class WalletAppConfig(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private lazy val rescanThreadFactory: ThreadFactory =
|
|
||||||
AsyncUtil.getNewThreadFactory("bitcoin-s-rescan")
|
|
||||||
|
|
||||||
/** Threads for rescanning the wallet */
|
|
||||||
private[wallet] lazy val rescanThreadPool: ExecutorService =
|
|
||||||
Executors.newFixedThreadPool(
|
|
||||||
Runtime.getRuntime.availableProcessors(),
|
|
||||||
rescanThreadFactory
|
|
||||||
)
|
|
||||||
|
|
||||||
override lazy val callbackFactory: WalletCallbacks.type = WalletCallbacks
|
override lazy val callbackFactory: WalletCallbacks.type = WalletCallbacks
|
||||||
|
|
||||||
lazy val kmConf: KeyManagerAppConfig =
|
lazy val kmConf: KeyManagerAppConfig =
|
||||||
|
@ -280,7 +270,6 @@ case class WalletAppConfig(
|
||||||
// in the future, we should actually cancel all things that are scheduled
|
// in the future, we should actually cancel all things that are scheduled
|
||||||
// manually, and then shutdown the scheduler
|
// manually, and then shutdown the scheduler
|
||||||
scheduler.shutdownNow()
|
scheduler.shutdownNow()
|
||||||
rescanThreadPool.shutdownNow()
|
|
||||||
super.stop()
|
super.stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ import org.bitcoins.wallet.models.{
|
||||||
import org.bitcoins.wallet.WalletLogger
|
import org.bitcoins.wallet.WalletLogger
|
||||||
|
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
import scala.concurrent.{ExecutionContext, Future, Promise}
|
import scala.concurrent.{Future, Promise}
|
||||||
import scala.util.{Failure, Success}
|
import scala.util.{Failure, Success}
|
||||||
|
|
||||||
case class RescanHandling(
|
case class RescanHandling(
|
||||||
|
@ -50,8 +50,7 @@ case class RescanHandling(
|
||||||
system: ActorSystem)
|
system: ActorSystem)
|
||||||
extends RescanHandlingApi
|
extends RescanHandlingApi
|
||||||
with WalletLogger {
|
with WalletLogger {
|
||||||
private implicit val rescanEC: ExecutionContext =
|
import system.dispatcher
|
||||||
ExecutionContext.fromExecutor(walletConfig.rescanThreadPool)
|
|
||||||
private def walletCallbacks: WalletCallbacks = walletConfig.callBacks
|
private def walletCallbacks: WalletCallbacks = walletConfig.callBacks
|
||||||
private val stateDescriptorDAO: WalletStateDescriptorDAO =
|
private val stateDescriptorDAO: WalletStateDescriptorDAO =
|
||||||
walletDAOs.stateDescriptorDAO
|
walletDAOs.stateDescriptorDAO
|
||||||
|
|
Loading…
Add table
Reference in a new issue