From b8024e290141b78cea4ebd43a82ade5f1a2c3f5a Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Mon, 28 Oct 2024 09:26:37 -0700 Subject: [PATCH] Start and stop precaching agent if appropriate --- code/cli/munki/shared/updatecheck/download.swift | 2 +- code/cli/munki/shared/updatecheck/updatecheck.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/cli/munki/shared/updatecheck/download.swift b/code/cli/munki/shared/updatecheck/download.swift index 768abf43..ee742cae 100644 --- a/code/cli/munki/shared/updatecheck/download.swift +++ b/code/cli/munki/shared/updatecheck/download.swift @@ -432,7 +432,7 @@ let PRECACHING_AGENT_LABEL = "com.googlecode.munki.precache_agent" /// Kick off a run of our precaching agent, which allows the precaching to /// run in the background after a normal Munki run -func runPrecachingAgent() { +func startPrecachingAgent() { if itemsToPrecache(getInstallInfo() ?? PlistDict()).isEmpty { // nothing to precache displayDebug1("Nothing found to precache.") diff --git a/code/cli/munki/shared/updatecheck/updatecheck.swift b/code/cli/munki/shared/updatecheck/updatecheck.swift index ed095cea..89ec0056 100644 --- a/code/cli/munki/shared/updatecheck/updatecheck.swift +++ b/code/cli/munki/shared/updatecheck/updatecheck.swift @@ -277,7 +277,7 @@ func checkForUpdates(clientID: String? = nil, localManifestPath: String? = nil) } // stop precaching_agent if it's running - // TODO: stopPrecachingAgent() + stopPrecachingAgent() // prevent idle sleep only if we are on AC power var caffeinator: Caffeinator? = nil @@ -547,7 +547,7 @@ func checkForUpdates(clientID: String? = nil, localManifestPath: String? = nil) // start our precaching agent // note -- this must happen _after_ InstallInfo.plist gets written to disk. - // TODO: download.run_precaching_agent() + startPrecachingAgent() if !success { return .finishedWithErrors