Skip to content

Commit

Permalink
fix: indexer config reading sqs enabled value (#8431) (#8432)
Browse files Browse the repository at this point in the history
* fix: indexer config reading sqs enabled value

* changelog

(cherry picked from commit 725afda)

Co-authored-by: Roman <roman@osmosis.team>
  • Loading branch information
mergify[bot] and p0mvn authored Jun 23, 2024
1 parent 32a78ad commit 4cc7cd2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* [#8420](https://github.com/osmosis-labs/osmosis/pull/8420) Remove further unneeded IBC acknowledgements time from CheckTx/RecheckTx.

### Config

* [#8431](https://github.com/osmosis-labs/osmosis/pull/8431) Fix osmosis-indexer config bug that read osmosis-sqs value

## v25.1.2

* [#8415](https://github.com/osmosis-labs/osmosis/pull/8415) Reset cache on pool creation
Expand Down
14 changes: 8 additions & 6 deletions osmoutils/config_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (

// ParseBool parses a boolean value from a server type option.
func ParseBool(opts servertypes.AppOptions, groupOptName, optName string, defaultValue bool) bool {
fullOptName := "osmosis-sqs." + optName
fullOptName := groupOptName + "." + optName
valueInterface := opts.Get(fullOptName)
value := defaultValue
if valueInterface != nil {
valueStr, ok := valueInterface.(string)
if !ok {
panic("invalidly configured osmosis-sqs." + optName)
panic("invalidly configured " + fullOptName)
}
valueStr = strings.TrimSpace(valueStr)
v, err := strconv.ParseBool(valueStr)
Expand All @@ -34,9 +34,10 @@ func ParseBool(opts servertypes.AppOptions, groupOptName, optName string, defaul

// ParseInt parses an integer value from a server type option.
func ParseInt(opts servertypes.AppOptions, groupOptName, optName string) int {
valueInterface := opts.Get(groupOptName + "." + optName)
fullOptName := groupOptName + "." + optName
valueInterface := opts.Get(fullOptName)
if valueInterface == nil {
panic("missing config for osmosis-sqs." + optName)
panic("missing config for " + fullOptName)
}
value := cast.ToInt(valueInterface)
return value
Expand Down Expand Up @@ -86,9 +87,10 @@ func ParseStringToUint64Slice(input string) ([]uint64, error) {

// ParseString parses a string value from a server type option.
func ParseString(opts servertypes.AppOptions, groupOptName, optName string) string {
valueInterface := opts.Get(groupOptName + "." + optName)
fullOptName := groupOptName + "." + optName
valueInterface := opts.Get(fullOptName)
if valueInterface == nil {
panic("missing config for osmosis-sqs." + optName)
panic("missing config for " + fullOptName)
}
value := cast.ToString(valueInterface)
return value
Expand Down

0 comments on commit 4cc7cd2

Please sign in to comment.