Skip to content

Commit a8138f0

Browse files
committed
clear timeout on fail case
1 parent e71f63e commit a8138f0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/templates/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ <h2>Ask Defang</h2>
335335
readStream();
336336
})
337337
.catch(error => {
338+
clearTimeout(timeoutId); // Clear timeout if request fails
338339
if (error.name === 'AbortError') {
339340
assistantResponse.textContent = 'Request timed out. Please try again in a moment.';
340341
console.error('Request timed out. Error: ', error);

0 commit comments

Comments
 (0)