Skip to content

Commit

Permalink
fix: increase download request timeout in development
Browse files Browse the repository at this point in the history
  • Loading branch information
stdavis committed Dec 22, 2023
1 parent 2b1e78a commit 4f1e3bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/search-wizard/Wizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,16 @@ export default function SearchWizard() {

/** @type {{ success: boolean; error?: string; id?: string }} */
let result;
// the dev server can be very slow...
const timeoutSeconds = import.meta.env.DEV ? 120 : 30;
try {
result = await ky
.post(`${import.meta.env.VITE_DOWNLOAD_URL}/create_job`, {
json: {
layers,
format,
},
timeout: 1000 * 30, // 30 seconds
timeout: 1000 * timeoutSeconds,
})
.json();
} catch (error) {
Expand Down

0 comments on commit 4f1e3bc

Please sign in to comment.