lncfg+itest: expose configurable batch-commit-interval

This will permit a greater degree of tuning or customization depending
on various hardware/environmental factors.
This commit is contained in:
Conner Fromknecht
2020-11-24 16:40:54 -08:00
parent e8c545e909
commit 82a238317c
8 changed files with 58 additions and 26 deletions

3
lnd.go
View File

@@ -1381,6 +1381,7 @@ func initializeDatabases(ctx context.Context,
databaseBackends.LocalDB,
channeldb.OptionSetRejectCacheSize(cfg.Caches.RejectCacheSize),
channeldb.OptionSetChannelCacheSize(cfg.Caches.ChannelCacheSize),
channeldb.OptionSetBatchCommitInterval(cfg.DB.BatchCommitInterval),
channeldb.OptionDryRunMigration(cfg.DryRunMigration),
)
switch {
@@ -1409,6 +1410,7 @@ func initializeDatabases(ctx context.Context,
databaseBackends.LocalDB,
channeldb.OptionSetRejectCacheSize(cfg.Caches.RejectCacheSize),
channeldb.OptionSetChannelCacheSize(cfg.Caches.ChannelCacheSize),
channeldb.OptionSetBatchCommitInterval(cfg.DB.BatchCommitInterval),
channeldb.OptionDryRunMigration(cfg.DryRunMigration),
)
switch {
@@ -1433,6 +1435,7 @@ func initializeDatabases(ctx context.Context,
remoteChanDB, err = channeldb.CreateWithBackend(
databaseBackends.RemoteDB,
channeldb.OptionDryRunMigration(cfg.DryRunMigration),
channeldb.OptionSetBatchCommitInterval(cfg.DB.BatchCommitInterval),
)
switch {
case err == channeldb.ErrDryRunMigrationOK: