Skip to content

Commit

Permalink
update spanner emulator logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ecordell committed Aug 12, 2022
1 parent 8bacc25 commit 4c2af61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/datastore/spanner/spanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ func NewSpannerDatastore(database string, opts ...Option) (datastore.Datastore,
return nil, fmt.Errorf(errUnableToInstantiate, err)
}

if len(config.emulatorHost) > 0 {
if len(config.emulatorHost) > 0 || len(os.Getenv("SPANNER_EMULATOR_HOST")) > 0 {
os.Setenv("SPANNER_EMULATOR_HOST", config.emulatorHost)
log.Info().Str("spanner-emulator-host", os.Getenv("SPANNER_EMULATOR_HOST")).Msg("running against spanner emulator")
}

config.gcInterval = common.WithJitter(0.2, config.gcInterval)
log.Info().Float64("factor", 0.2).Msg("gc configured with jitter")
log.Info().Str("spanner-emulator-host", os.Getenv("SPANNER_EMULATOR_HOST")).Msg("spanner emulator")

client, err := spanner.NewClient(context.Background(), database, option.WithCredentialsFile(config.credentialsFilePath))
if err != nil {
Expand Down

0 comments on commit 4c2af61

Please sign in to comment.