From aff60af8ba24c8d5330c706ddf26927d81436d79 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 26 Jan 2026 08:08:17 -1000 Subject: 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 --- internal/api/http.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'internal/api/http.go') diff --git a/internal/api/http.go b/internal/api/http.go index df28c65..d9ddf0e 100644 --- a/internal/api/http.go +++ b/internal/api/http.go @@ -7,7 +7,8 @@ import ( "fmt" "io" "net/http" - "time" + + "task-dashboard/internal/config" ) // BaseClient provides common HTTP functionality for API clients @@ -19,7 +20,7 @@ type BaseClient struct { // NewBaseClient creates a new BaseClient with default settings func NewBaseClient(baseURL string) BaseClient { return BaseClient{ - HTTPClient: &http.Client{Timeout: 15 * time.Second}, + HTTPClient: &http.Client{Timeout: config.HTTPClientTimeout}, BaseURL: baseURL, } } -- cgit v1.2.3