Start and stop precaching agent if appropriate

This commit is contained in:
Greg Neagle
2024-10-28 09:26:37 -07:00
parent 346a68df02
commit b8024e2901
2 changed files with 3 additions and 3 deletions

View File

@@ -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.")

View File

@@ -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