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
|
||||
|
||||
lazy val kmConf: KeyManagerAppConfig =
|
||||
|
@ -280,7 +270,6 @@ case class WalletAppConfig(
|
|||
// in the future, we should actually cancel all things that are scheduled
|
||||
// manually, and then shutdown the scheduler
|
||||
scheduler.shutdownNow()
|
||||
rescanThreadPool.shutdownNow()
|
||||
super.stop()
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.bitcoins.wallet.models.{
|
|||
import org.bitcoins.wallet.WalletLogger
|
||||
|
||||
import java.time.Instant
|
||||
import scala.concurrent.{ExecutionContext, Future, Promise}
|
||||
import scala.concurrent.{Future, Promise}
|
||||
import scala.util.{Failure, Success}
|
||||
|
||||
case class RescanHandling(
|
||||
|
@ -50,8 +50,7 @@ case class RescanHandling(
|
|||
system: ActorSystem)
|
||||
extends RescanHandlingApi
|
||||
with WalletLogger {
|
||||
private implicit val rescanEC: ExecutionContext =
|
||||
ExecutionContext.fromExecutor(walletConfig.rescanThreadPool)
|
||||
import system.dispatcher
|
||||
private def walletCallbacks: WalletCallbacks = walletConfig.callBacks
|
||||
private val stateDescriptorDAO: WalletStateDescriptorDAO =
|
||||
walletDAOs.stateDescriptorDAO
|
||||
|
|
Loading…
Add table
Reference in a new issue