From c3d5fe64c268d7ca85d1e303b98201391f28c9e9 Mon Sep 17 00:00:00 2001 From: Agando Date: Wed, 10 Jun 2026 18:00:19 +0200 Subject: auto: 2026-06-10_18:00 changes --- modules/core/module-searxng.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'modules/core/module-searxng.js') diff --git a/modules/core/module-searxng.js b/modules/core/module-searxng.js index 24db0f5..2feb982 100644 --- a/modules/core/module-searxng.js +++ b/modules/core/module-searxng.js @@ -38,13 +38,18 @@ class SearXNGModule { const categoryLabel = category === 'images' ? '🖼️' : (category === 'videos' ? '🎬' : '🔍'); this.terminal.print(`${categoryLabel} Searching ${category}: ${query}`, 'info'); + if (summarize) this.terminal.print('⏳ AI overview will be generated (1-3s)...', 'info'); let params = 'q=' + encodeURIComponent(query) + '&categories=' + category; if (summarize) params += '&summarize=true'; if (fetchContent) params += '&fetch_content=true'; try { - const resp = await fetch('/api/search?' + params); + // 30s client-side timeout (matches module-fetcher) + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), 30000); + const resp = await fetch('/api/search?' + params, { signal: controller.signal }); + clearTimeout(timer); if (!resp.ok) { const err = await resp.json().catch(() => ({})); this.terminal.print('Search failed: ' + (err.error || 'HTTP ' + resp.status), 'error'); @@ -100,7 +105,11 @@ class SearXNGModule { } }); } catch (e) { - this.terminal.print('Search failed: ' + e.message, 'error'); + if (e.name === 'AbortError') { + this.terminal.print('⏱ Search timed out (30s). Try removing --summarize or --fetch flags.', 'error'); + } else { + this.terminal.print('Search failed: ' + e.message, 'error'); + } } } } -- cgit v1.2.3