Skip to content

Commit

Permalink
Merge pull request #1669 from automatisch/helix-attemtps
Browse files Browse the repository at this point in the history
fix: Add artificial delay to Helix API attempts
  • Loading branch information
farukaydin committed Feb 27, 2024
2 parents 2449baa + 65a0c3b commit 7f324ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/backend/src/apps/helix/actions/new-chat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default defineAction({

let attempts = 0;

while (attempts < 50) {
while (attempts < 10) {
const response = await $.http.get(`/api/v1/sessions/${sessionId}`);

const message =
Expand All @@ -46,6 +46,7 @@ export default defineAction({
return;
}

await new Promise((resolve) => setTimeout(resolve, 1000));
attempts++;
}

Expand Down

0 comments on commit 7f324ab

Please sign in to comment.