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
This commit is contained in:
parent
ed84541050
commit
529829a561
@ -4,6 +4,7 @@
|
|||||||
const { GLib, Gio, GObject, Shell, St } = imports.gi;
|
const { GLib, Gio, GObject, Shell, St } = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
|
const ExtensionDownloader = imports.ui.extensionDownloader;
|
||||||
const ExtensionUtils = imports.misc.extensionUtils;
|
const ExtensionUtils = imports.misc.extensionUtils;
|
||||||
const FileUtils = imports.misc.fileUtils;
|
const FileUtils = imports.misc.fileUtils;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
@ -16,6 +17,8 @@ const DISABLED_EXTENSIONS_KEY = 'disabled-extensions';
|
|||||||
const DISABLE_USER_EXTENSIONS_KEY = 'disable-user-extensions';
|
const DISABLE_USER_EXTENSIONS_KEY = 'disable-user-extensions';
|
||||||
const EXTENSION_DISABLE_VERSION_CHECK_KEY = 'disable-extension-version-validation';
|
const EXTENSION_DISABLE_VERSION_CHECK_KEY = 'disable-extension-version-validation';
|
||||||
|
|
||||||
|
const UPDATE_CHECK_TIMEOUT = 24 * 60 * 60; // 1 day in seconds
|
||||||
|
|
||||||
var ExtensionManager = class {
|
var ExtensionManager = class {
|
||||||
constructor() {
|
constructor() {
|
||||||
this._initialized = false;
|
this._initialized = false;
|
||||||
@ -49,6 +52,12 @@ var ExtensionManager = class {
|
|||||||
|
|
||||||
this._installExtensionUpdates();
|
this._installExtensionUpdates();
|
||||||
this._sessionUpdated();
|
this._sessionUpdated();
|
||||||
|
|
||||||
|
GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, UPDATE_CHECK_TIMEOUT, () => {
|
||||||
|
ExtensionDownloader.checkForUpdates();
|
||||||
|
return GLib.SOURCE_CONTINUE;
|
||||||
|
});
|
||||||
|
ExtensionDownloader.checkForUpdates();
|
||||||
}
|
}
|
||||||
|
|
||||||
lookup(uuid) {
|
lookup(uuid) {
|
||||||
|
Loading…
Reference in New Issue
Block a user