Skip to content

Commit

Permalink
chore: set replicated as empty string when not set (#311)
Browse files Browse the repository at this point in the history
Signed-off-by: Prashant Shahi <[email protected]>
  • Loading branch information
prashant-shahi authored Apr 8, 2024
1 parent 2916d1c commit 5953729
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmd/signozschemamigrator/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ func main() {

// set SIGNOZ_REPLICATED env var so that golang-migrate can use it
// the value of this env would replace all occurences of {{.SIGNOZ_REPLICATED}} in the migration files
signozReplicated := ""
logger.Info("Setting env var SIGNOZ_REPLICATED", zap.Bool("replication", replicationEnabled))
if replicationEnabled {
logger.Info("Setting env var SIGNOZ_REPLICATED", zap.Bool("replication", replicationEnabled))
err = os.Setenv("SIGNOZ_REPLICATED", "Replicated")
if err != nil {
logger.Fatal("Failed to set env var SIGNOZ_REPLICATED", zap.Error(err))
}
signozReplicated = "Replicated"
}
err = os.Setenv("SIGNOZ_REPLICATED", signozReplicated)
if err != nil {
logger.Fatal("Failed to set env var SIGNOZ_REPLICATED", zap.Error(err))
}

manager, err := migrationmanager.New(dsn, clusterName, disableDurationSortFeature, disableTimestampSortFeature, verboseLoggingEnabled, replicationEnabled)
Expand Down

0 comments on commit 5953729

Please sign in to comment.