From 25a2acb634212455abeb0a0c8fb1a97c3ece3a2c Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 6 Feb 2026 10:26:05 -0600 Subject: fix(calendar-sync): increase fetch timeout for large calendars Google calendar (7k+ events, 4.5MB) was hitting the 30s hard-coded curl timeout. Use configurable calendar-sync-fetch-timeout (default 120s) with a separate 10s connect-timeout for fast failure on unreachable hosts. --- modules/calendar-sync.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/calendar-sync.el b/modules/calendar-sync.el index 022aff80..6753e5fe 100644 --- a/modules/calendar-sync.el +++ b/modules/calendar-sync.el @@ -125,6 +125,13 @@ Default: 3 months. This keeps recent history visible in org-agenda.") "Number of months in the future to include when expanding recurring events. Default: 12 months. This provides a full year of future events.") +(defvar calendar-sync-fetch-timeout 120 + "Maximum time in seconds for a calendar fetch to complete. +This is the total time allowed for the entire transfer (connect + download). +Large calendars (thousands of events) may need more time on slow connections. +A separate 10-second connect timeout ensures fast failure when a host is +unreachable.") + ;;; Internal state (defvar calendar-sync--timer nil @@ -1269,7 +1276,10 @@ invoked when the fetch completes, either successfully or with an error." (make-process :name "calendar-sync-curl" :buffer buffer - :command (list "curl" "-s" "-L" "-m" "30" url) + :command (list "curl" "-s" "-L" + "--connect-timeout" "10" + "--max-time" (number-to-string calendar-sync-fetch-timeout) + url) :sentinel (lambda (process event) (when (memq (process-status process) '(exit signal)) -- cgit v1.2.3