Skip to content

Add option to display PADD only once and exit #443

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

Merged
merged 2 commits into from
Apr 5, 2025
Merged

Conversation

yubiuser
Copy link
Member

@yubiuser yubiuser commented Mar 6, 2025

What does this PR aim to accomplish?:

As the title says, add the option --runonce to display PADD dashboard once and immediately exit.

Fixes #431


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

@yubiuser yubiuser requested a review from a team March 6, 2025 09:37
@yubiuser yubiuser mentioned this pull request Mar 6, 2025
@XhmikosR
Copy link

XhmikosR commented Mar 7, 2025

While this works, it isn't nearly as fast as the previous built-in chronometer, unfortunately. :/

I guess it might be better than nothing for now and works.

@yubiuser
Copy link
Member Author

yubiuser commented Mar 7, 2025

While this works, it isn't nearly as fast as the previous built-in chronometer, unfortunately. :/

What do you mean exactly with 'not as fast'? Which step? Why do you need speed in an app the is meant to run contentiously and sleeps for 5 seconds on each round?

@XhmikosR
Copy link

XhmikosR commented Mar 7, 2025

I mean the initial display takes a lot longer compared to the old built-in chronometer (pihole -c -e), but like I said, it's better than nothing and it works :)

@yubiuser
Copy link
Member Author

yubiuser commented Mar 7, 2025

I've been thinking about removing the startup countdown (which adds at least 3 seconds) for a long time. Maybe this should be done now, at least for --runonce?

@XhmikosR
Copy link

XhmikosR commented Mar 7, 2025

I'm testing this on a slow device RPi 1 Model B:

real	0m15.731s
user	0m9.602s
sys	0m1.969s

I don't recall exactly how long it took with the old built-in chronometer, though :/

@yubiuser
Copy link
Member Author

yubiuser commented Mar 7, 2025

The slowness on RPi 1 is probably due to the jq handling of the API's JSON.
You know, you can run PADD now remotely on your super-beefy main machine which should be much faster ;-)

With the startup countdown removed
2025-03-07_09-30

@XhmikosR
Copy link

XhmikosR commented Mar 7, 2025

Can you push the patch so that I give it a go too?

@XhmikosR
Copy link

XhmikosR commented Mar 7, 2025

real	0m13.132s
user	0m9.524s
sys	0m1.920s

@yubiuser
Copy link
Member Author

yubiuser commented Mar 7, 2025

Saved 2,5 sec

@XhmikosR
Copy link

XhmikosR commented Mar 7, 2025

Yup, not bad.

@yubiuser yubiuser changed the title Add option to display PADD only once an exit Add option to display PADD only once and exit Mar 16, 2025
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link

Conflicts have been resolved.

@yubiuser yubiuser requested a review from DL6ER March 28, 2025 19:05
@yubiuser yubiuser merged commit 2440291 into development Apr 5, 2025
5 checks passed
@yubiuser yubiuser deleted the run/once branch April 5, 2025 15:43
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.

Provide option to mimic discontinued chronometer and exit PADD when run
3 participants