Skip to content

Commit

Permalink
Add last refresh time
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 committed Jan 22, 2024
1 parent 025e0b0 commit e8ef52e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/io.elementary.settings-daemon.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
</schema>

<schema path="/io/elementary/settings-daemon/system-updates/" id="io.elementary.settings-daemon.system-updates">
<key type="x" name="last-refresh-time">
<default>0</default>
<summary>When updates were last refreshed</summary>
<description>When the cache was last refreshed and checked for updates in unix utc.</description>
</key>
<key type="x" name="refresh-interval">
<default>86400</default>
<summary>How often to check for updates</summary>
Expand Down
2 changes: 2 additions & 0 deletions src/Backends/SystemUpdate.vala
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public class SettingsDaemon.Backends.SystemUpdate : Object {
try {
available_updates = (yield task.get_updates_async (Pk.Filter.NONE, null, progress_callback)).get_package_sack ();

settings.set_int64 ("last-refresh-time", new DateTime.now_utc ().to_unix ());

if (available_updates == null || available_updates.get_size () == 0) {
update_state (UP_TO_DATE);
return;
Expand Down

0 comments on commit e8ef52e

Please sign in to comment.