summaryrefslogtreecommitdiff
path: root/cmd/dashboard/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/dashboard/main.go')
-rw-r--r--cmd/dashboard/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go
index d7da061..6b895d1 100644
--- a/cmd/dashboard/main.go
+++ b/cmd/dashboard/main.go
@@ -90,8 +90,11 @@ func main() {
var googleCalendarClient api.GoogleCalendarAPI
if cfg.HasGoogleCalendar() {
+ // Use timeout context to prevent startup hangs if credentials file is unreachable
+ initCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
var err error
- googleCalendarClient, err = api.NewGoogleCalendarClient(context.Background(), cfg.GoogleCredentialsFile, cfg.GoogleCalendarID)
+ googleCalendarClient, err = api.NewGoogleCalendarClient(initCtx, cfg.GoogleCredentialsFile, cfg.GoogleCalendarID)
+ cancel()
if err != nil {
log.Printf("Warning: failed to initialize Google Calendar client: %v", err)
} else {