mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-18 21:34:39 +01:00
Run migrations upfront (#4607)
This commit is contained in:
parent
d0dadfa423
commit
a0851fea58
@ -8,6 +8,7 @@ import org.bitcoins.commons.config.{AppConfig, ConfigOps}
|
||||
import org.bitcoins.commons.util.ServerArgParser
|
||||
import org.bitcoins.core.config.NetworkParameters
|
||||
import org.bitcoins.core.util.{StartStopAsync, TimeUtil}
|
||||
import org.bitcoins.db.DbManagement
|
||||
import org.bitcoins.dlc.node.config.DLCNodeAppConfig
|
||||
import org.bitcoins.dlc.wallet.DLCAppConfig
|
||||
import org.bitcoins.keymanager.config.KeyManagerAppConfig
|
||||
@ -80,6 +81,12 @@ case class BitcoinSAppConfig(
|
||||
val torDependentConfigs =
|
||||
Vector(nodeConf, bitcoindRpcConf, dlcConf, dlcNodeConf)
|
||||
|
||||
val dbConfigs: Vector[DbManagement] =
|
||||
Vector(chainConf, walletConf, nodeConf, dlcConf)
|
||||
|
||||
//run all migrations here to avoid issues like: https://github.com/bitcoin-s/bitcoin-s/issues/4606
|
||||
val _ = dbConfigs.map(_.migrate())
|
||||
|
||||
val startedTorDependentConfigsF = for {
|
||||
_ <- torConfig
|
||||
_ <- Future.sequence(torDependentConfigs.map(_.start()))
|
||||
|
Loading…
Reference in New Issue
Block a user