From 529829a5612142b3acc96d545fd041c841520721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 27 Jan 2020 00:59:19 +0100 Subject: [PATCH] extensionSystem: Periodically check for extension updates Now that we can download, apply and display extension updates, it is time to actually check for updates. Schedule an update check right on startup, then every 24 hours. https://gitlab.gnome.org/GNOME/gnome-shell/issues/1968 --- js/ui/extensionSystem.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index e520186d9..9d883505e 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -4,6 +4,7 @@ const { GLib, Gio, GObject, Shell, St } = imports.gi; const Signals = imports.signals; +const ExtensionDownloader = imports.ui.extensionDownloader; const ExtensionUtils = imports.misc.extensionUtils; const FileUtils = imports.misc.fileUtils; const Main = imports.ui.main; @@ -16,6 +17,8 @@ const DISABLED_EXTENSIONS_KEY = 'disabled-extensions'; const DISABLE_USER_EXTENSIONS_KEY = 'disable-user-extensions'; const EXTENSION_DISABLE_VERSION_CHECK_KEY = 'disable-extension-version-validation'; +const UPDATE_CHECK_TIMEOUT = 24 * 60 * 60; // 1 day in seconds + var ExtensionManager = class { constructor() { this._initialized = false; @@ -49,6 +52,12 @@ var ExtensionManager = class { this._installExtensionUpdates(); this._sessionUpdated(); + + GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, UPDATE_CHECK_TIMEOUT, () => { + ExtensionDownloader.checkForUpdates(); + return GLib.SOURCE_CONTINUE; + }); + ExtensionDownloader.checkForUpdates(); } lookup(uuid) {