add more details on the payload sent to webhook audit (#20335)

This commit is contained in:
Harshavardhana
2024-08-28 08:31:56 -07:00
committed by GitHub
parent fb2360ff88
commit c65e67c357
3 changed files with 40 additions and 24 deletions

View File

@@ -20,6 +20,7 @@ package store
import (
"encoding/json"
"errors"
"fmt"
"os"
"path/filepath"
"sort"
@@ -107,17 +108,18 @@ func (store *QueueStore[_]) Delete() error {
// PutMultiple - puts an item to the store.
func (store *QueueStore[I]) PutMultiple(item []I) error {
store.Lock()
defer store.Unlock()
if uint64(len(store.entries)) >= store.entryLimit {
return errLimitExceeded
}
// Generate a new UUID for the key.
key, err := uuid.NewRandom()
if err != nil {
return err
}
return store.multiWrite(key.String(), item)
store.Lock()
defer store.Unlock()
if uint64(len(store.entries)) >= store.entryLimit {
return errLimitExceeded
}
return store.multiWrite(fmt.Sprintf("%d:%s", len(item), key.String()), item)
}
// multiWrite - writes an item to the directory.