Skip to content

Commit

Permalink
+ added destroyed versions in event meta (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcoulombe committed Sep 5, 2023
1 parent 58789e7 commit bad88f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions path_destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package kv

import (
"context"
"encoding/json"
"fmt"
"net/http"

Expand Down Expand Up @@ -100,9 +101,14 @@ func (b *versionedKVBackend) pathDestroyWrite() framework.OperationFunc {
return nil, err
}
}
marshaledVersions, err := json.Marshal(&versions)
if err != nil {
return nil, err
}
kvEvent(ctx, b.Backend, "destroy", "destroy/"+key, "", true, 2,
"current_version", fmt.Sprintf("%d", meta.CurrentVersion),
"oldest_version", fmt.Sprintf("%d", meta.OldestVersion),
"destroyed_versions", string(marshaledVersions),
)
return nil, nil
}
Expand Down

0 comments on commit bad88f4

Please sign in to comment.