From f7fbaadf9b673197ef863cf0b19272816016e8aa Mon Sep 17 00:00:00 2001 From: Brian Huisman Date: Thu, 16 May 2024 13:33:37 -0400 Subject: [PATCH] Kludge for 524 Cloudflare timeout response There is no need to cancel the crawler for an HTTP 524 response. --- orcinus/js/admin.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/orcinus/js/admin.js b/orcinus/js/admin.js index a96a211..e9999f1 100644 --- a/orcinus/js/admin.js +++ b/orcinus/js/admin.js @@ -747,16 +747,19 @@ os_crawl_start.addEventListener('click', function(e) { } else if (response.status >= 500) { clearInterval(os_crawl_interval); - os_crawl_cancel.reason = 'The crawler unexpectedly halted with HTTP response code ' + response.status + ': ' + response.statusText; + if (response.status != 524) { + os_crawl_cancel.reason = 'The crawler unexpectedly halted with HTTP response code ' + response.status + ': ' + response.statusText; - alert( - 'Error: ' + os_crawl_cancel.reason + "\n" + - 'The crawl will be cancelled and reset.' - ); + alert( + 'Error: ' + os_crawl_cancel.reason + "\n" + + 'The crawl will be cancelled and reset.' + ); - console.error('Error: ', error); - os_crawl_cancel.force = true; - os_crawl_cancel.click(); + console.error('Error: ', error); + os_crawl_cancel.force = true; + os_crawl_cancel.click(); + + } else alert('Cloudflare has timed out your connection to the crawler. The crawler is still running; refresh the page to see ongoing updates.'); } });