From 669df62cdef31533617746a6bb73e043607f7768 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 4 Aug 2025 17:23:33 -0400 Subject: [PATCH] Closes #18873: Add a request timeout parameter to the RSS feed dashboard widget (#20004) --- netbox/extras/dashboard/widgets.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/netbox/extras/dashboard/widgets.py b/netbox/extras/dashboard/widgets.py index 2173dc786..c8805bd57 100644 --- a/netbox/extras/dashboard/widgets.py +++ b/netbox/extras/dashboard/widgets.py @@ -309,6 +309,7 @@ class RSSFeedWidget(DashboardWidget): default_config = { 'max_entries': 10, 'cache_timeout': 3600, # seconds + 'request_timeout': 3, # seconds 'requires_internet': True, } description = _('Embed an RSS feed from an external website.') @@ -335,6 +336,12 @@ class RSSFeedWidget(DashboardWidget): max_value=86400, # 24 hours help_text=_('How long to stored the cached content (in seconds)') ) + request_timeout = forms.IntegerField( + min_value=1, + max_value=60, + required=False, + help_text=_('Timeout value for fetching the feed (in seconds)') + ) def render(self, request): return render_to_string(self.template_name, { @@ -366,7 +373,7 @@ class RSSFeedWidget(DashboardWidget): url=self.config['feed_url'], headers={'User-Agent': f'NetBox/{settings.RELEASE.version}'}, proxies=resolve_proxies(url=self.config['feed_url'], context={'client': self}), - timeout=3 + timeout=self.config.get('request_timeout', 3), ) response.raise_for_status() except requests.exceptions.RequestException as e: