Skip to content

Commit

Permalink
fix: cannot write against a read-only redis replica (#1378)
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
  • Loading branch information
cre8ivejp authored Dec 10, 2024
1 parent ff14e70 commit 3a29bbd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
12 changes: 1 addition & 11 deletions pkg/api/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,17 +608,7 @@ func (s *gatewayService) getEnvironmentAPIKey(
)
return nil, errInternal
}
envAPIKey := resp.EnvironmentApiKey
if err := environmentAPIKeyCache.Put(envAPIKey); err != nil {
logger.Error(
"Failed to cache environment APIKey",
log.FieldsFromImcomingContext(ctx).AddFields(
zap.Error(err),
zap.String("environmentID", envAPIKey.Environment.Id),
)...,
)
}
return envAPIKey, nil
return resp.EnvironmentApiKey, nil
}

func (s *gatewayService) evaluateFeatures(
Expand Down
1 change: 0 additions & 1 deletion pkg/api/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func TestGetEnvironmentAPIKey(t *testing.T) {
Environment: &environmentproto.EnvironmentV2{Id: "ns0"},
ApiKey: &accountproto.APIKey{Id: "id-0"},
}}, nil)
gs.environmentAPIKeyCache.(*cachev3mock.MockEnvironmentAPIKeyCache).EXPECT().Put(gomock.Any()).Return(nil)
},
auth: "test-key",
expected: &accountproto.EnvironmentAPIKey{
Expand Down

0 comments on commit 3a29bbd

Please sign in to comment.