Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ linters:
- testableexamples # checks if examples are testable (have an expected output)
- testpackage # makes you use a separate _test package
- paralleltest # not every test should be in parallel
- tparallel # table-driven tests share mock servers for performance
- wrapcheck # not required
- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines
- wsl_v5 # [too strict and mostly code is not more readable] add or remove empty lines
Expand Down
10 changes: 4 additions & 6 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ func run(ctx context.Context, cancel context.CancelFunc, cfg *config.ServerConfi
// Get GitHub token from one of the installations
var githubToken string
for _, org := range githubManager.AllOrgs() {
if client, ok := githubManager.ClientForOrg(org); ok {
githubToken = client.InstallationToken(ctx)
if ghClient, ok := githubManager.ClientForOrg(org); ok {
githubToken = ghClient.InstallationToken(ctx)
break
}
}
Expand Down Expand Up @@ -671,8 +671,6 @@ func (cm *coordinatorManager) handleRefreshInstallations(ctx context.Context) {
// runBotCoordinators manages bot coordinators for all GitHub installations.
// It spawns one coordinator per org and refreshes the list every 5 minutes.
// Failed coordinators are automatically restarted every minute.
//
//nolint:interfacebloat // Interface mirrors state.Store for local type safety
func runBotCoordinators(
ctx context.Context,
slackManager *slack.Manager,
Expand Down Expand Up @@ -733,7 +731,7 @@ func runBotCoordinators(

// Run cleanup once on startup
go func() {
if err := stateStore.Cleanup(); err != nil {
if err := stateStore.Cleanup(context.Background()); err != nil {
slog.Warn("initial state cleanup failed", "error", err)
}
}()
Expand Down Expand Up @@ -767,7 +765,7 @@ func runBotCoordinators(
case <-cleanupTicker.C:
// Periodic cleanup of old state data
go func() {
if err := stateStore.Cleanup(); err != nil {
if err := stateStore.Cleanup(context.Background()); err != nil {
slog.Warn("state cleanup failed", "error", err)
} else {
slog.Debug("state cleanup completed successfully")
Expand Down
Loading
Loading