Skip to content

Commit d2ea75a

Browse files
committed
chore: make presigned_url_expiration required
Signed-off-by: bestmike007 <i@bestmike007.com>
1 parent 42d8826 commit d2ea75a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

internal/config/config.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ type (
126126
}
127127

128128
GcpConfig struct {
129-
Project string `mapstructure:"project" validate:"required"`
130-
Bucket string `mapstructure:"bucket"`
131-
PresignedUrlExpiration *time.Duration `mapstructure:"presigned_url_expiration"`
129+
Project string `mapstructure:"project" validate:"required"`
130+
Bucket string `mapstructure:"bucket"`
131+
PresignedUrlExpiration time.Duration `mapstructure:"presigned_url_expiration" validate:"required"`
132132
}
133133

134134
DynamoDBConfig struct {

internal/storage/blobstorage/gcs/blob_storage.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func New(params BlobStorageParams) (internal.BlobStorage, error) {
8080
if len(params.Config.GCP.Bucket) == 0 {
8181
return nil, xerrors.Errorf("GCP bucket not configure for blob storage")
8282
}
83-
if params.Config.GCP.PresignedUrlExpiration == nil {
83+
if params.Config.GCP.PresignedUrlExpiration == 0 {
8484
return nil, xerrors.Errorf("GCP presign url expiration not configure for blob storage")
8585
}
8686
ctx := context.Background()
@@ -98,7 +98,7 @@ func New(params BlobStorageParams) (internal.BlobStorage, error) {
9898
project: params.Config.GCP.Project,
9999
bucket: params.Config.GCP.Bucket,
100100
client: client,
101-
presignedUrlExpiration: *params.Config.GCP.PresignedUrlExpiration,
101+
presignedUrlExpiration: params.Config.GCP.PresignedUrlExpiration,
102102
blobStorageMetrics: blobStorageMetrics,
103103
instrumentUpload: instrument.NewWithResult[string](metrics, "upload"),
104104
instrumentDownload: instrument.NewWithResult[*api.Block](metrics, "download"),

0 commit comments

Comments
 (0)