summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-02-06 10:26:05 -0600
committerCraig Jennings <c@cjennings.net>2026-02-06 10:26:05 -0600
commit25a2acb634212455abeb0a0c8fb1a97c3ece3a2c (patch)
tree0770f924d20dc157616feb9b385f597cfe6bc490 /modules
parenta980541c7300001181a25c2ed80401766d3abcaa (diff)
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/calendar-sync.el12
1 files changed, 11 insertions, 1 deletions
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))