diff --git a/cmd/worker/storage/main.go b/cmd/worker/storage/main.go index 072b68f..c66c943 100644 --- a/cmd/worker/storage/main.go +++ b/cmd/worker/storage/main.go @@ -73,9 +73,16 @@ func runSingleWorker(ctx context.Context, rdb *redis.Client, consumerID int, sc log.Error().Err(err).Msg("Failed to unmarshal payload") continue } - storageKeys := make([]string, len(data)) - for i, item := range data { - storageKeys[i] = item.StorageKey + storageKeys := make([]string, 0, len(data)) + for _, item := range data { + if item != nil && item.StorageKey != "" { + storageKeys = append(storageKeys, item.StorageKey) + } + } + if len(storageKeys) == 0 { + log.Info().Str("worker", consumerName).Msg("No valid storage keys found in bulk delete payload") + rdb.XAck(ctx, constants.StreamStorageName, constants.GroupStorageName, message.ID) + continue } log.Info(). Str("worker", consumerName). diff --git a/docs/docs.go b/docs/docs.go index c5080a6..5b564f6 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -2229,8 +2229,7 @@ const docTemplate = `{ "history-api_internal_dtos_request.ChangePasswordDto": { "type": "object", "required": [ - "new_password", - "old_password" + "new_password" ], "properties": { "new_password": { diff --git a/docs/swagger.json b/docs/swagger.json index f160ca1..74c1b64 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -2222,8 +2222,7 @@ "history-api_internal_dtos_request.ChangePasswordDto": { "type": "object", "required": [ - "new_password", - "old_password" + "new_password" ], "properties": { "new_password": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index a20ea75..94b7c32 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -12,7 +12,6 @@ definitions: type: string required: - new_password - - old_password type: object history-api_internal_dtos_request.ChangeRoleDto: properties: diff --git a/internal/services/authService.go b/internal/services/authService.go index 2555348..927abde 100644 --- a/internal/services/authService.go +++ b/internal/services/authService.go @@ -171,7 +171,6 @@ func (a *authService) Signin(ctx context.Context, dto *request.SignInDto) (*resp } - func (a *authService) Logout(ctx context.Context, userId string) error { pgID, err := convert.StringToUUID(userId) if err != nil { diff --git a/pkg/validator/validator.go b/pkg/validator/validator.go index 44745ec..73a759b 100644 --- a/pkg/validator/validator.go +++ b/pkg/validator/validator.go @@ -42,8 +42,6 @@ func init() { }) } - - func isValidURL(s string) bool { u, err := url.ParseRequestURI(s) if err != nil {