Skip to content

Commit cc91eda

Browse files
Alec CunninghamAlec Cunningham
Alec Cunningham
authored and
Alec Cunningham
committed
chore: address cfg ref in router
1 parent 51e10fe commit cc91eda

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pkg/api/router.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ import (
66
"github.com/moosh3/github-actions-aggregator/pkg/config"
77
"github.com/moosh3/github-actions-aggregator/pkg/db"
88
"github.com/moosh3/github-actions-aggregator/pkg/github"
9+
"github.com/moosh3/github-actions-aggregator/pkg/worker"
910
)
1011

11-
func StartServer(cfg *config.Config, db *db.Database, githubClient *github.Client) {
12+
func StartServer(cfg *config.Config, db *db.Database, githubClient *github.Client, worker *worker.WorkerPool) {
1213
r := gin.Default()
1314

1415
// Public routes
1516
r.GET("/login", auth.GitHubLogin)
1617
r.GET("/callback", auth.GitHubCallback)
1718

1819
// Webhook route (exclude middleware that could interfere)
19-
webhookHandler := github.NewWebhookHandler(db, githubClient, cfg.Github.WebhookSecret)
20+
webhookHandler := github.NewWebhookHandler(db, githubClient, cfg.GitHub.WebhookSecret, worker)
2021
r.POST("/webhook", webhookHandler.HandleWebhook)
2122

2223
// Protected routes

pkg/github/polling.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ import (
1515
const maxConcurrentPolls = 10
1616

1717
type Poller struct {
18-
db *db.Database
19-
ghClient *gh.Client
20-
interval time.Duration
21-
repositories []models.Repository
18+
db *db.Database
19+
ghClient *gh.Client
20+
interval time.Duration
2221
}
2322

2423
func NewPoller(db *db.Database, token *oauth2.Token, interval time.Duration) *Poller {
@@ -84,7 +83,7 @@ func (p *Poller) pollWorkflows(repo models.Repository) {
8483
}
8584
}
8685

87-
func (p *Poller) pollWorkflowRuns(owner, repoName string, workflow *gh.Workflow) {
86+
func (p *Poller) pollWorkflowRuns(owner string, repoName string, workflow *gh.Workflow) {
8887
opts := &gh.ListWorkflowRunsOptions{
8988
ListOptions: gh.ListOptions{PerPage: 50},
9089
}

0 commit comments

Comments
 (0)