diff options
| author | Craig Jennings <c@cjennings.net> | 2026-02-06 10:26:05 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-02-06 10:26:05 -0600 |
| commit | f7cc6eacd75eb45a3df24baf2d623427ee1ad4ff (patch) | |
| tree | 19d3222148305e9a74e91649fcce438761486647 | |
| parent | edbbc3d217c47dad0751c1ab77b716e76e9fa310 (diff) | |
| download | dotemacs-f7cc6eacd75eb45a3df24baf2d623427ee1ad4ff.tar.gz dotemacs-f7cc6eacd75eb45a3df24baf2d623427ee1ad4ff.zip | |
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.
| -rw-r--r-- | modules/calendar-sync.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/calendar-sync.el b/modules/calendar-sync.el index 022aff80c..6753e5fef 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)) |
