Skip to content

Commit

Permalink
fix: Fixing empty metadata passed on response of update
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Jan 29, 2023
1 parent cdfebfb commit be4716e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
)

func (a App) Update(ctx context.Context, item absto.Item, opts ...provider.MetadataAction) (provider.Metadata, error) {
var metadata provider.Metadata
var output provider.Metadata

return metadata, a.exclusiveApp.Execute(ctx, "fibr:mutex:"+item.ID, exclusive.Duration, func(ctx context.Context) error {
return output, a.exclusiveApp.Execute(ctx, "fibr:mutex:"+item.ID, exclusive.Duration, func(ctx context.Context) error {
var err error

metadata, err := a.GetMetadataFor(ctx, item)
Expand All @@ -29,6 +29,8 @@ func (a App) Update(ctx context.Context, item absto.Item, opts ...provider.Metad
return fmt.Errorf("save metadata: %w", err)
}

output = metadata

return nil
})
}

0 comments on commit be4716e

Please sign in to comment.