Skip to content

Commit

Permalink
Delay initial check for updates by default 60 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
vjr committed Feb 5, 2025
1 parent 6632322 commit 02079e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Backends/SystemUpdate.vala
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class SettingsDaemon.Backends.SystemUpdate : Object {

private const string NOTIFICATION_ID = "system-update";

private const int DELAY_INITIAL_CHECK_SECONDS = 60;

public signal void state_changed ();

private static Settings settings = new GLib.Settings ("io.elementary.settings-daemon.system-update");
Expand Down Expand Up @@ -58,7 +60,10 @@ public class SettingsDaemon.Backends.SystemUpdate : Object {
warning ("Couldn't determine last offline results: %s", e.message);
}

check_for_updates.begin (false, true);
Timeout.add_seconds (DELAY_INITIAL_CHECK_SECONDS, () => {
check_for_updates.begin (true, true);
return Source.REMOVE;
});

Timeout.add_seconds ((uint) settings.get_int64 ("refresh-interval"), () => {
check_for_updates.begin (false, true);
Expand Down

0 comments on commit 02079e0

Please sign in to comment.