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

fix: Optimize the "News" function and avoid unexpected behaviors #213

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

Antiz96
Copy link
Owner

@Antiz96 Antiz96 commented Jul 9, 2024

Description

This commit brings multiple improvements to the "News" function of the main script in order to optimize it and avoid unexpected behaviors:

  • Print a message when Arch-Update is looking for recent Arch News (to avoid people thinking the script is just stuck in case it takes some time due to network instability/slowness)
  • Print a message if no recent Arch News has been found since the last run
  • Optimize the curl requests by merging the two first ones into a single one
  • Add a default 30 sec timeout (--max-time 30) to curl requests so they don't end taking multiple minutes on slow/faulty network connection). If the timeout is reached, Arch-Update prints a warning explaining that it wasn't able to retrieve Arch News in a reasonable time, prints the URL of the Arch website or the URL of the selected news (so users can still look that up separately) and move on to the packages updates.

Screenshots / Logs

2024-07-09_10-26

2024-07-09_10-25

Fixed bug

Fixes #206

This commit brings multiple improvements to the "News" function of the main script in order to optimize it and avoid unexpected behaviors:

- Print a message when Arch-Update is looking for recent Arch News (to avoid people thinking the script is just stuck in case it takes some time due to network instability/slowness)
- Print a message if no recent Arch News has been found since the last run
- Optimize the curl requests by merging the two first ones into a single one
- Add a default 30 sec timeout (`--max-time 30`) to curl requests so they don't end taking multiple minutes on slow/faulty network connection). If the timeout is reached, Arch-Update prints a warning explaining that it wasn't able to retrieve Arch News in a reasonable time, prints the URL of the Arch website or the URL of the selected news (so users can still look that up separately) and move on to the packages updates.

Fixes #206
@Antiz96 Antiz96 merged commit a16a160 into main Jul 9, 2024
1 check passed
@Antiz96 Antiz96 deleted the optimize_news branch July 9, 2024 11:03
@Antiz96 Antiz96 added this to the v2.3.0 milestone Jul 9, 2024
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.

Optimize the "News" function and add a timeout to curl requests
1 participant