Skip to content

Commit

Permalink
add sp nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanGuedes committed Jun 21, 2024
1 parent 464ab34 commit 6f7aea4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/storage/stores/shipper/bloomshipper/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,15 +494,16 @@ func newCachedListOpObjectClient(oc client.ObjectClient, ttl, interval time.Dura

func (c *cachedListOpObjectClient) List(ctx context.Context, prefix string, delimiter string) ([]client.StorageObject, []client.StorageCommonPrefix, error) {
var (
sp = opentracing.SpanFromContext(ctx)
start = time.Now()
cacheDur time.Duration
)
defer func() {
sp.LogKV(
"cache_duration", cacheDur,
"total_duration", time.Since(start),
)
if sp := opentracing.SpanFromContext(ctx); sp != nil {
sp.LogKV(
"cache_duration", cacheDur,
"total_duration", time.Since(start),
)
}
}()

if delimiter != "" {
Expand Down

0 comments on commit 6f7aea4

Please sign in to comment.