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 http/http keyword timeout option #2142

Merged
merged 24 commits into from
Aug 6, 2023

Conversation

zenyr
Copy link
Contributor

@zenyr zenyr commented Sep 30, 2022

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

Type of change

  • User interface (UI)
  • New feature (non-breaking change which adds functionality)
  • Translation update (minor and 🇰🇷 only, running script added a bunch of missing i18n data 😏 )
    • edit: reverted non-english & non-Korean files

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas
    (including JSDoc for methods)
  • My changes generate no new warnings

Screenshots (if any)

image

@@ -606,6 +611,10 @@ export default {
if (this.monitor.retryInterval === oldValue) {
this.monitor.retryInterval = value;
}
// keep timeoutMs below interval, minding the unit conversion
if (!this.monitor.timeoutMs || this.monitor.timeoutMs >= value * 1000) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could it be be better to limit to 80% here? What are your thoughts? Your choice!

Copy link
Contributor

Choose a reason for hiding this comment

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

It might be a good idea to have some sort of limit to make sure that the previous request has definitely finished before the next one is sent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you prefer less or equal than 80% of the interval seconds I can change it at once ;)
Please let me know. (cc. @louislam asking for owner's opinion)

Copy link
Contributor

@Computroniks Computroniks left a comment

Choose a reason for hiding this comment

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

Please don't add the English translations to non English files as it will fall back to the English translation if no other translation is found and will just cause merge conflicts later. I assume you ran npm run update-language-files.

@louislam Should we perhaps change this script so it doesn't update all the files and instead only changes a specific one? I don't really see any situation where it it useful and it only seems to create work for contributers when they run it and commit the results, only to be told to revert it.

@zenyr
Copy link
Contributor Author

zenyr commented Oct 2, 2022

I see, let me update the PR to comply the best practice!

src/languages/ko-KR.js Outdated Show resolved Hide resolved
@zenyr
Copy link
Contributor Author

zenyr commented Oct 2, 2022

I forgot to commit the updated en.js, just pushed one! 😼

ps: We're using Uptime Kuma @ https://status.mymusictaste.net/

@louislam
Copy link
Owner

louislam commented Oct 6, 2022

Please don't add the English translations to non English files as it will fall back to the English translation if no other translation is found and will just cause merge conflicts later. I assume you ran npm run update-language-files.

@louislam Should we perhaps change this script so it doesn't update all the files and instead only changes a specific one? I don't really see any situation where it it useful and it only seems to create work for contributers when they run it and commit the results, only to be told to revert it.

Oh yes, the command is bad.

@zenyr
Copy link
Contributor Author

zenyr commented Oct 7, 2022

Please don't add the English translations to non English files as it will fall back to the English translation if no other translation is found and will just cause merge conflicts later. I assume you ran npm run update-language-files.
@louislam Should we perhaps change this script so it doesn't update all the files and instead only changes a specific one? I don't really see any situation where it it useful and it only seems to create work for contributers when they run it and commit the results, only to be told to revert it.

Oh yes, the command is bad.

Yeah, so I reverted all the artifacts that it created in this PR 😄 Since my team needs this feature and fixes a lot of pending issues is there something I could do to proceed with this PR? I'm sorry if I'm too attached to this feature but due to the fact our VPS network being flakey (like, losing a packet or few randomly) I really would like to use this feature in the stable version..! 😅

Thank you and ❤️ your work,
UK made me brave enough to hop into Vue train even though I've been a long time ⚛️ enthusiast.

@Eliepse
Copy link

Eliepse commented Nov 25, 2022

Would love to see this feature merged. Is there anything that prevent it? I'm willing to help if I can :)

@Eliepse
Copy link

Eliepse commented Nov 26, 2022

Just tested this PR, works fine for me 👍

image

@louislam louislam added this to the 1.20.0 milestone Nov 26, 2022
@usufu
Copy link

usufu commented Jan 5, 2023

@zenyr any docker image for this feature? or how to update docker image with this feature? I need this feature. thx.
why the pull request still not merged? @Computroniks @louislam

@i-am-dev
Copy link

Hi.

Any update on this PR and possibly when it will be merged?

Thanks.

@i-am-dev
Copy link

Hi.

Any update on this PR and possibly when it will be merged?

Thanks.

Nevermind. I see now that it is part of the 1.20.0 milestone.

Any due date for the release yet?

Thanks.

@louislam louislam added the question Further information is requested label Jan 30, 2023
@borgogelli
Copy link

already a timeout notification

@lightingman117 you have written: "there is already a timeout notification"
But where is it ?

@CommanderStorm CommanderStorm mentioned this pull request Jun 20, 2023
1 task
@louislam louislam removed the question Further information is requested label Jun 28, 2023
@CommanderStorm CommanderStorm mentioned this pull request Jul 5, 2023
2 tasks
@louislam louislam added the question Further information is requested label Jul 8, 2023
@louislam
Copy link
Owner

louislam commented Jul 8, 2023

The edit page is no longer working, here is the browser console log:

image

// limit to 80% of interval
const maxTimeout = this.monitor.interval * 0.8;
// 0 will be treated as 80% of interval
this.monitor.timeout = Math.Max(0, Math.min(timeout, maxTimeout));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a very amateur like mistake from my side. My bad!

@zenyr
Copy link
Contributor Author

zenyr commented Jul 14, 2023

Just resolved "Math.Max" typo for the PR. Sorry for the hassle!
I must've been too excited when I added the line.

@louislam
Copy link
Owner

Test it again, unfortunately, newly created monitor doesn't seem to be working.

Weird default value:
image

I manually inputted 48 seconds, but the monitor timeout in 48ms. Forgot to x1000?
image

Old monitor, the original interval is 60s and the request time is 48s, then I change the interval to 30s.

The request time became this:
image

@zenyr
Copy link
Contributor Author

zenyr commented Jul 16, 2023

Sure! I will ping you again once I finish testing the code first, I had issues setting up dev env on a new device(for personal reasons) but definitely will do!

@zenyr
Copy link
Contributor Author

zenyr commented Jul 18, 2023

Fixed a few things, with proper dev setup this time 😅
timeout-test

  1. Co-located timeout field with intervals, making their relation more clear
  2. Used different formula to clamp to 80%, resulting better fraction numbers for edit/add view. ( t*0.8 => ~~(t * 8)/10) -- much unlikely to have 2.000000000004 epsilon error
  3. Displays 80% inside the UI label that should directly hint 0 == default value(80%) (since timeout of 0 literally makes 0 sense)
  • This is not visible in the GIF below but in the source code, monitor.timeout || clampTimeout( interval ) is used.
  1. Added db migration code to the last place, fixing current conflicts

zenyr and others added 4 commits July 28, 2023 00:30
Co-authored-by: Frank Elsinga <frank@elsinga.de>
# Conflicts:
#	server/database.js
#	server/server.js
#	src/pages/EditMonitor.vue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet