From be4716e15e339637913f7036e25fdfdc0ebba4c8 Mon Sep 17 00:00:00 2001 From: Vincent Boutour Date: Sun, 29 Jan 2023 18:47:24 +0100 Subject: [PATCH] fix: Fixing empty metadata passed on response of update Signed-off-by: Vincent Boutour --- pkg/metadata/metadata.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/metadata/metadata.go b/pkg/metadata/metadata.go index 774efc27..a6f25495 100644 --- a/pkg/metadata/metadata.go +++ b/pkg/metadata/metadata.go @@ -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) @@ -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 }) }