diff options
Diffstat (limited to 'cmd/dashboard')
| -rw-r--r-- | cmd/dashboard/main.go | 5 |
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 { |
