Skip to content

Changes to updates check #164

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Dangermouse-UK
Copy link

Modified update check to use getLastInstallDate and modfied getLastUpdateDate to detect changes.
If a change is detected then the getNumberOfAvailableUpdates is called to get the number of updates. Moved this into the 5 min cycle but left the existing 4 hour check in place just in case

For the above to work reliably we need to trigger apt update regularly so either via crontab or adding the following to /etc/apt/apt.conf.d/10periodic

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";

I left the original 4 hour check in place for if this is not done as we may need it then even if it is less accurate.

These changes mean upd on the card is now reflecting the last date an update was applied and the number of updates is updated quicker and more acciurately

@bsimmo
Copy link

bsimmo commented May 8, 2025 via email

@Dangermouse-UK
Copy link
Author

Dangermouse-UK commented May 8, 2025

It should not be hammering the servers. This makes use of apt doing periodic (set by n days) checks - mine is 1 daily.
All the 5 min check is doing is comparing two timestamps and if it sees a difference then it goes and does the
call to get the number of available updates via apt so all it should be doing is the following:

  1. Calling every 4 hours as originally done
  2. Calling whenever an apt update has been run and new updates detected (which is controlled outside of here either daily or by running apt update manually)

I put the following in /etc/apt/apt.conf.d/10periodic to do a daily check:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";

I left Stephens original 4hr check in because if we never run apt update nothing will really change here and an apt upgrade periodically is better than nothing.

I like to keep my pis's updated or see the number available however I still want to do it manuually rather than automatically so now this gives the best of both worlds

Put try/except around getDaemonreleases get from kz0q.com
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