Skip to content

Set fetch timeout to 5 minutes#6217

Merged
Jarred-Sumner merged 2 commits intomainfrom
jarred/increase-timeouts
Oct 3, 2023
Merged

Set fetch timeout to 5 minutes#6217
Jarred-Sumner merged 2 commits intomainfrom
jarred/increase-timeouts

Conversation

@Jarred-Sumner
Copy link
Collaborator

What does this PR do?

  • Set the default timeout for fetch to 5 minutes instead of 60 seconds

How did you verify your code works?

Existing tests

@Jarred-Sumner
Copy link
Collaborator Author

Fixes #4799
Fixes #5930

@remorses
Copy link
Contributor

remorses commented Oct 1, 2023

Why do you need a default timeout?

@Jarred-Sumner
Copy link
Collaborator Author

Why do you need a default timeout?

Processes generally shouldn't hang forever. The timeout is not an absolute number, it is since the last time a message was received. You can disable the timeout for fetch with timeout: false

@Jarred-Sumner Jarred-Sumner merged commit b444c0b into main Oct 3, 2023
@Jarred-Sumner Jarred-Sumner deleted the jarred/increase-timeouts branch October 3, 2023 01:02
@empz
Copy link

empz commented Oct 10, 2024

Why do you need a default timeout?

Processes generally shouldn't hang forever. The timeout is not an absolute number, it is since the last time a message was received. You can disable the timeout for fetch with timeout: false

Sorry to post here, but where do you set this?

Bun.fetch(url, {
  method: "POST",
  body: someBody,
  timeout: false // Typescript doesn't like
}

image

Is it a types problem and the argument actually works??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants