Skip to content

feat: configurable file write timeouts#1653

Merged
0xERR0R merged 6 commits into0xERR0R:mainfrom
TheoTechnicguy:feat/custom-write-timeout-1606
Dec 17, 2024
Merged

feat: configurable file write timeouts#1653
0xERR0R merged 6 commits into0xERR0R:mainfrom
TheoTechnicguy:feat/custom-write-timeout-1606

Conversation

@TheoTechnicguy
Copy link
Copy Markdown
Contributor

This pull request introduces changes to the HTTP server configuration to make it more flexible and configurable. The change include adding a new configuration parameter for write timeouts, updating the HTTP server initialization to use this new parameter, and adjusting the server creation logic accordingly.

This PR answers issue #1606.

This commit adds a write timeout configuration parameter. As it is part
of the downloading cycle, it is available under
`blocking/loading/downloads`.
The default value comes from `server/http.go` line 23.

Refs: 0xERR0R#1606
@TheoTechnicguy
Copy link
Copy Markdown
Contributor Author

I have some lingering questions. Should the read timeouts that are currently hardcoded also be migrated to configurable values (possibly in a separate PR)?
I also did not find any test cases for the parts I touched. Did I miss them?

@TheoTechnicguy TheoTechnicguy marked this pull request as ready for review December 4, 2024 19:36
@0xERR0R
Copy link
Copy Markdown
Owner

0xERR0R commented Dec 10, 2024

I have some lingering questions. Should the read timeouts that are currently hardcoded also be migrated to configurable values (possibly in a separate PR)? I also did not find any test cases for the parts I touched. Did I miss them?

I would say, it is always better to have some parameters configurable for power user and default values which are ok for the most cases ;)

We don't have any tests which cover http timeouts

Copy link
Copy Markdown
Owner

@0xERR0R 0xERR0R 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 your contribution! Should I merge your change or do you want to add something?

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.91%. Comparing base (fe84ab8) to head (4744d8f).
Report is 159 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1653      +/-   ##
==========================================
+ Coverage   93.88%   93.91%   +0.02%     
==========================================
  Files          78       80       +2     
  Lines        6361     6572     +211     
==========================================
+ Hits         5972     6172     +200     
- Misses        300      316      +16     
+ Partials       89       84       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheoTechnicguy
Copy link
Copy Markdown
Contributor Author

I would say, it is always better to have some parameters configurable for power user and default values which are ok for the most cases ;)

I'll do that.

Should I merge your change or do you want to add something?

IMO, this PR is ready for merging; I intend to add both configuration parameters in separate PRs. If you prefer having them in one bigger PR, I can add the commits here.

TheoTechnicguy added a commit to TheoTechnicguy/blocky that referenced this pull request Dec 13, 2024
This commit adds a request read timeout configuration parameter. As it
is part of the downloading cycle, it is available under
`blocking/loading/downloads`.
The default value comes from `server/http.go` line 22.

Refs: 0xERR0R#1653
TheoTechnicguy added a commit to TheoTechnicguy/blocky that referenced this pull request Dec 13, 2024
This commit adds a request header read timeout configuration parameter.
As it is part of the downloading cycle, it is available under
`blocking/loading/downloads`.
The default value comes from `server/http.go` line 21.

Refs: 0xERR0R#1653
@0xERR0R 0xERR0R merged commit e485df1 into 0xERR0R:main Dec 17, 2024
0xERR0R pushed a commit that referenced this pull request Dec 23, 2024
* feat(config): read read timeout value

This commit adds a request read timeout configuration parameter. As it
is part of the downloading cycle, it is available under
`blocking/loading/downloads`.
The default value comes from `server/http.go` line 22.

Refs: #1653

* feat(server): get read timeout from config

* feat(docs): document additional config parameter

* refactor(server): remove superfluous spaces
0xERR0R pushed a commit that referenced this pull request Jan 1, 2025
* feat(config): read read header timeout value

This commit adds a request header read timeout configuration parameter.
As it is part of the downloading cycle, it is available under
`blocking/loading/downloads`.
The default value comes from `server/http.go` line 21.

Refs: #1653

* feat(server): get read header timeout from config

* feat(docs): document additional config parameter
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