Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add requestTimeout to avoid long running queries #26

Merged
merged 4 commits into from
Aug 23, 2024

Conversation

sidharthv96
Copy link
Member

Without timeout, if a network error occurs, it takes ~15 minutes to throw an error.

Copy link

vercel bot commented Aug 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
office-plugin-site ⬜️ Ignored (Inspect) Visit Preview Aug 23, 2024 1:14pm

Copy link
Contributor

@aloisklink aloisklink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A hard-coded 5 second timeout seems a bit short for me, especially if there's no way to change this.

I've often programmed on trains/cellular connections, and it's entirely possible I might lose internet connection for a few seconds.

I think we need a parameter option for this, with a larger default timeout. ky uses 10 seconds as a default, so maybe we can use that too? https://github.com/sindresorhus/ky/blob/cac5fbd2f79de2339eb3b3d084d521d3e5d4c0bc/source/core/Ky.ts#L144

This would also be a breaking change, but d536be5 is unreleased and is a breaking change anyway, so that's not too big of a deal.

Copy link
Contributor

@aloisklink aloisklink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for those changes.

One last thing before merging, can you add an entry to the CHANGELOG.md under the [UNRELEASED] section, e.g. something like:

## [UNRELEASED]

### Changes

- Set a 30 second default timeout for all requests

### Added

- Added `requestTimeout` option to configure timeout.

After that, feel free to merge whenever!

@sidharthv96 sidharthv96 merged commit de2b733 into main Aug 23, 2024
14 checks passed
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.

2 participants