Skip to content

Commit

Permalink
Add rate limits
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Kisler <admin@dkisler.com>
  • Loading branch information
kislerdm committed Nov 28, 2023
1 parent b335ee4 commit 1d92861
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/internal/github/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"log/slog"
"net/http"
"os"
"time"

"github.com/hashicorp/go-cleanhttp"
"github.com/hashicorp/go-retryablehttp"
Expand Down Expand Up @@ -51,10 +52,10 @@ func NewClient(ctx context.Context, log *slog.Logger, token string) Client {
httpClient: retryClient,
ghClient: githubv4.NewClient(httpClient),

cliThrottle: NewDummyThrottle(),
apiThrottle: NewDummyThrottle(),
assetThrottle: NewDummyThrottle(),
rssThrottle: NewDummyThrottle(),
cliThrottle: NewThrottle(ctx, time.Second/30, 30),
apiThrottle: NewThrottle(ctx, time.Second, 3),
assetThrottle: NewThrottle(ctx, time.Second/30, 30),
rssThrottle: NewThrottle(ctx, time.Second/30, 30),
}
/* TODO
retryClient := retryablehttp.NewClient()
Expand Down

0 comments on commit 1d92861

Please sign in to comment.