Bug 1908842: update password generator prompt text r=android-reviewers,gl
[gecko.git] / browser / modules / BackgroundTask_install.sys.mjs
blob510e14bccb90eee77c6a6ffa28ec3c16f175788e
1 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /**
7  * This task ought to have an ephemeral profile and should not apply updates.
8  * These settings are controlled externally, by
9  * `BackgroundTasks::IsUpdatingTaskName` and
10  * `BackgroundTasks::IsEphemeralProfileTaskName`.
11  */
13 // This happens synchronously during installation. It shouldn't take that long
14 // and if something goes wrong we really don't want to sit around waiting for
15 // it.
16 export const backgroundTaskTimeoutSec = 30;
18 export async function runBackgroundTask() {
19   console.log("Running BackgroundTask_install.");
21   console.log("Cleaning up update files.");
22   try {
23     Cc["@mozilla.org/updates/update-manager;1"]
24       .getService(Ci.nsIUpdateManager)
25       .doInstallCleanup();
26   } catch (ex) {
27     console.error(ex);
28   }