summaryrefslogtreecommitdiff
path: root/internal/store
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/store
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/store')
-rw-r--r--internal/store/sqlite.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/store/sqlite.go b/internal/store/sqlite.go
index 12aa1ce..c2f6e98 100644
--- a/internal/store/sqlite.go
+++ b/internal/store/sqlite.go
@@ -13,6 +13,7 @@ import (
_ "github.com/mattn/go-sqlite3"
+ "task-dashboard/internal/config"
"task-dashboard/internal/models"
)
@@ -47,9 +48,9 @@ func New(dbPath, migrationDir string) (*Store, error) {
// Configure connection pool for SQLite with WAL mode
// WAL allows concurrent reads, but writes still need serialization
- db.SetMaxOpenConns(5)
- db.SetMaxIdleConns(2)
- db.SetConnMaxLifetime(time.Hour)
+ db.SetMaxOpenConns(config.SQLiteMaxOpenConns)
+ db.SetMaxIdleConns(config.SQLiteMaxIdleConns)
+ db.SetConnMaxLifetime(config.SQLiteConnMaxLifetime)
store := &Store{db: db, migrationDir: migrationDir}