summaryrefslogtreecommitdiff
path: root/internal/api/trello.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-01-26 08:08:17 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-01-26 08:08:17 -1000
commitaff60af8ba24c8d5330c706ddf26927d81436d79 (patch)
tree60d13f58663473a3db204d8a11f2cc8f6e65445f /internal/api/trello.go
parent8c2b8c352f8c980c79bb4bb4772e8cbc02d14164 (diff)
Phase 4: Extract magic numbers to constants
Create config/constants.go with centralized configuration values: - Concurrency limits (MaxConcurrentTrelloRequests) - Timeouts (HTTP, Google Calendar, graceful shutdown, request) - Meal times (breakfast, lunch, dinner hours) - Database pool settings (connections, lifetime) - Session and rate limiting settings Update all files to use these constants instead of hardcoded values. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/api/trello.go')
-rw-r--r--internal/api/trello.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/api/trello.go b/internal/api/trello.go
index 67ffad0..a276726 100644
--- a/internal/api/trello.go
+++ b/internal/api/trello.go
@@ -9,6 +9,7 @@ import (
"sync"
"time"
+ "task-dashboard/internal/config"
"task-dashboard/internal/models"
)
@@ -170,7 +171,7 @@ func (c *TrelloClient) GetBoardsWithCards(ctx context.Context) ([]models.Board,
var wg sync.WaitGroup
var mu sync.Mutex // Protects writes to boards slice elements
- sem := make(chan struct{}, 5) // Limit to 5 concurrent requests
+ sem := make(chan struct{}, config.MaxConcurrentTrelloRequests)
for i := range boards {
wg.Add(1)