This commit is contained in:
Max Goedjen
2024-12-26 19:28:30 -05:00
parent 2dc317d398
commit 970e407e29
13 changed files with 281 additions and 257 deletions

View File

@@ -69,26 +69,24 @@ struct Secretive: App {
extension Secretive {
private func reinstallAgent() {
// justUpdatedChecker.check()
// FIXME: THIS
// LaunchAgentController().install {
// // Wait a second for launchd to kick in (next runloop isn't enough).
// DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
// agentStatusChecker.check()
// if !agentStatusChecker.running {
// forceLaunchAgent()
// }
// }
// }
justUpdatedChecker.check()
Task {
await LaunchAgentController().install()
try? await Task.sleep(for: .seconds(1))
agentStatusChecker.check()
if !agentStatusChecker.running {
forceLaunchAgent()
}
}
}
private func forceLaunchAgent() {
// We've run setup, we didn't just update, launchd is just not doing it's thing.
// Force a launch directly.
// FIXME: THIS
// LaunchAgentController().forceLaunch { _ in
// agentStatusChecker.check()
// }
Task {
_ = await LaunchAgentController().forceLaunch()
agentStatusChecker.check()
}
}
}