Skip to content

Commit edb526a

Browse files
committed
fix: Use context.Background() in client constructors
1 parent 5ebdac8 commit edb526a

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

go/internal/feast/onlinestore/dynamodbonlinestore.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ func NewDynamodbOnlineStore(project string, config *registry.RepoConfig, onlineS
5050
}
5151

5252
// aws configuration
53-
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
54-
defer cancel()
53+
ctx := context.Background()
5554
cfg, err := awsConfig.LoadDefaultConfig(ctx)
5655
if err != nil {
5756
panic(err)

go/internal/feast/registry/gcs.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ type GCSRegistryStore struct {
4242
// NewGCSRegistryStore creates a GCSRegistryStore with the given configuration.
4343
func NewGCSRegistryStore(config *RegistryConfig, repoPath string) *GCSRegistryStore {
4444
var rs GCSRegistryStore
45-
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
46-
defer cancel()
45+
ctx := context.Background()
4746

4847
client, err := storage.NewClient(ctx)
4948
if err != nil {

go/internal/feast/registry/s3.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,21 @@ type S3RegistryStore struct {
2929

3030
// NewS3RegistryStore creates a S3RegistryStore with the given configuration
3131
func NewS3RegistryStore(config *RegistryConfig, repoPath string) *S3RegistryStore {
32-
var lr S3RegistryStore
33-
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
34-
defer cancel()
32+
var rs S3RegistryStore
33+
ctx := context.Background()
3534

3635
cfg, err := awsConfig.LoadDefaultConfig(ctx)
3736
if err != nil {
38-
lr = S3RegistryStore{
37+
rs = S3RegistryStore{
3938
filePath: config.Path,
4039
}
4140
} else {
42-
lr = S3RegistryStore{
41+
rs = S3RegistryStore{
4342
filePath: config.Path,
4443
s3Client: s3.NewFromConfig(cfg),
4544
}
4645
}
47-
return &lr
46+
return &rs
4847
}
4948

5049
func (r *S3RegistryStore) GetRegistryProto() (*core.Registry, error) {

0 commit comments

Comments
 (0)