Skip to content

Commit

Permalink
optimized redeliveries to make the fewest API calls we can for now
Browse files Browse the repository at this point in the history
  • Loading branch information
NorseGaud committed Nov 21, 2024
1 parent e157fda commit 9471436
Show file tree
Hide file tree
Showing 6 changed files with 345 additions and 197 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.1
0.9.2
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22.2
require (
github.com/bradleyfalzon/ghinstallation/v2 v2.11.0
github.com/gofri/go-github-ratelimit v1.1.0
github.com/google/go-github/v63 v63.0.0
github.com/google/go-github/v66 v66.0.0
github.com/google/uuid v1.6.0
github.com/redis/go-redis/v9 v9.5.1
github.com/shirou/gopsutil/v3 v3.24.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github/v62 v62.0.0 h1:/6mGCaRywZz9MuHyw9gD1CwsbmBX8GWsbFkwMmHdhl4=
github.com/google/go-github/v62 v62.0.0/go.mod h1:EMxeUqGJq2xRu9DYBMwel/mr7kZrzUOfQmmpYrZn2a4=
github.com/google/go-github/v63 v63.0.0 h1:13xwK/wk9alSokujB9lJkuzdmQuVn2QCPeck76wR3nE=
github.com/google/go-github/v63 v63.0.0/go.mod h1:IqbcrgUmIcEaioWrGYei/09o+ge5vhffGOcxrO0AfmA=
github.com/google/go-github/v66 v66.0.0 h1:ADJsaXj9UotwdgK8/iFZtv7MLc8E8WBl62WLd/D/9+M=
github.com/google/go-github/v66 v66.0.0/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
Expand Down
2 changes: 1 addition & 1 deletion internal/github/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"net/http"

"github.com/google/go-github/v63/github"
"github.com/google/go-github/v66/github"
"github.com/veertuinc/anklet/internal/config"
)

Expand Down
3 changes: 1 addition & 2 deletions plugins/handlers/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"time"

"github.com/bradleyfalzon/ghinstallation/v2"
"github.com/google/go-github/v63/github"
"github.com/google/go-github/v66/github"
"github.com/redis/go-redis/v9"
"github.com/veertuinc/anklet/internal/anka"
"github.com/veertuinc/anklet/internal/config"
Expand Down Expand Up @@ -161,7 +161,6 @@ func sendCancelWorkflowRun(pluginCtx context.Context, logger *slog.Logger, workf

// https://github.com/gofri/go-github-ratelimit has yet to support primary rate limits, so we have to do it ourselves.
func executeGitHubClientFunction[T any](pluginCtx context.Context, logger *slog.Logger, executeFunc func() (*T, *github.Response, error)) (context.Context, *T, *github.Response, error) {
logger.DebugContext(pluginCtx, "executeGitHubClientFunction")
result, response, err := executeFunc()
if response != nil {
pluginCtx = logging.AppendCtx(pluginCtx, slog.Int("api_limit_remaining", response.Rate.Remaining))
Expand Down
Loading

0 comments on commit 9471436

Please sign in to comment.