Skip to content

Commit

Permalink
Use globalint64
Browse files Browse the repository at this point in the history
  • Loading branch information
cabrador committed Nov 28, 2024
1 parent bec05e1 commit 0e31d8c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions cmd/sonicd/app/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ func lachesisMain(ctx *cli.Context) error {
}

metrics.SetDataDir(cfg.Node.DataDir) // report disk space usage into metrics
liveCache := ctx.Int64(flags.LiveDbCacheFlag.Name)
liveCache := ctx.GlobalInt64(flags.LiveDbCacheFlag.Name)
if liveCache > 0 {
cfg.OperaStore.EVM.StateDb.LiveCache = liveCache
}

archiveCache := ctx.Int64(flags.ArchiveCacheFlag.Name)
archiveCache := ctx.GlobalInt64(flags.ArchiveCacheFlag.Name)
if archiveCache > 0 {
cfg.OperaStore.EVM.StateDb.ArchiveCache = archiveCache
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/sonictool/app/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func exportEvents(ctx *cli.Context) error {

gdbParams := db.GossipDbParameters{
DataDir: dataDir,
LiveDbCache: ctx.Int64(flags.LiveDbCacheFlag.Name),
ArchiveCache: ctx.Int64(flags.ArchiveCacheFlag.Name),
LiveDbCache: ctx.GlobalInt64(flags.LiveDbCacheFlag.Name),
ArchiveCache: ctx.GlobalInt64(flags.ArchiveCacheFlag.Name),
}

log.Info("Exporting events to file", "file", fn)
Expand Down
4 changes: 2 additions & 2 deletions cmd/sonictool/app/export_genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func exportGenesis(ctx *cli.Context) error {
DataDir: dataDir,
ValidatorMode: false,
CacheRatio: cacheRatio,
LiveDbCache: ctx.Int64(flags.LiveDbCacheFlag.Name),
ArchiveCache: ctx.Int64(flags.ArchiveCacheFlag.Name),
LiveDbCache: ctx.GlobalInt64(flags.LiveDbCacheFlag.Name),
ArchiveCache: ctx.GlobalInt64(flags.ArchiveCacheFlag.Name),
})
if err != nil {
return err
Expand Down
12 changes: 6 additions & 6 deletions cmd/sonictool/app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func gfileGenesisImport(ctx *cli.Context) error {
DataDir: dataDir,
ValidatorMode: validatorMode,
CacheRatio: cacheRatio,
LiveDbCache: ctx.Int64(flags.LiveDbCacheFlag.Name),
ArchiveCache: ctx.Int64(flags.ArchiveCacheFlag.Name),
LiveDbCache: ctx.GlobalInt64(flags.LiveDbCacheFlag.Name),
ArchiveCache: ctx.GlobalInt64(flags.ArchiveCacheFlag.Name),
})
}

Expand Down Expand Up @@ -110,8 +110,8 @@ func jsonGenesisImport(ctx *cli.Context) error {
DataDir: dataDir,
ValidatorMode: validatorMode,
CacheRatio: cacheRatio,
LiveDbCache: ctx.Int64(flags.LiveDbCacheFlag.Name),
ArchiveCache: ctx.Int64(flags.ArchiveCacheFlag.Name),
LiveDbCache: ctx.GlobalInt64(flags.LiveDbCacheFlag.Name),
ArchiveCache: ctx.GlobalInt64(flags.ArchiveCacheFlag.Name),
})
}

Expand Down Expand Up @@ -146,8 +146,8 @@ func fakeGenesisImport(ctx *cli.Context) error {
DataDir: dataDir,
ValidatorMode: validatorMode,
CacheRatio: cacheRatio,
LiveDbCache: ctx.Int64(flags.LiveDbCacheFlag.Name),
ArchiveCache: ctx.Int64(flags.ArchiveCacheFlag.Name),
LiveDbCache: ctx.GlobalInt64(flags.LiveDbCacheFlag.Name),
ArchiveCache: ctx.GlobalInt64(flags.ArchiveCacheFlag.Name),
})
}

Expand Down

0 comments on commit 0e31d8c

Please sign in to comment.