Skip to content

Commit

Permalink
chore: remove tracing:
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei-Alexandru Dobre committed Jan 7, 2025
1 parent 6ee87bd commit ab5d7cd
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions internal/slackExt/client_rate_limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ package slackExt

import (
"context"
"fmt"
"time"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/slack-go/slack"
)

Expand All @@ -22,11 +20,8 @@ func rateLimit[R any](ctx context.Context, f func() (R, error), getZeroValue fun
}

if rateLimitedError, ok := err.(*slack.RateLimitedError); ok {
tflog.Trace(ctx, fmt.Sprintf("Rate limited, waiting %f", rateLimitedError.RetryAfter.Seconds()), map[string]any{})

select {
case <-time.After(rateLimitedError.RetryAfter):
tflog.Trace(ctx, "Rate limit wait complete", map[string]any{})
case <-ctx.Done():
return getZeroValue(), ctx.Err()
}
Expand Down

0 comments on commit ab5d7cd

Please sign in to comment.