[gnome-shell] extensionSystem: Periodically check for extension updates



commit 529829a5612142b3acc96d545fd041c841520721
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Jan 27 00:59:19 2020 +0100

    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 e520186d99..9d883505e3 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) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]