Skip to content

Commit

Permalink
feat(database): allow environment variables to override config.json (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yiweichi authored Sep 9, 2024
1 parent bce3383 commit 246bf38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime/debug"
)

var tag = "v4.4.59"
var tag = "v4.4.60"

var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
Expand Down
8 changes: 8 additions & 0 deletions database/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"encoding/json"
"os"
"path/filepath"

"scroll-tech/common/utils"
)

// DBConfig db config
Expand All @@ -29,5 +31,11 @@ func NewConfig(file string) (*DBConfig, error) {
return nil, err
}

// Override config with environment variables
err = utils.OverrideConfigWithEnv(cfg, "SCROLL_ROLLUP_DB_CONFIG")
if err != nil {
return nil, err
}

return cfg, nil
}

0 comments on commit 246bf38

Please sign in to comment.