Nanoseconds

This commit is contained in:
Max Goedjen 2021-12-11 18:14:16 -08:00
parent 079c2fabf0
commit 27f0b9b5b0
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8
2 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ extension Secretive {
Task { Task {
await LaunchAgentController().install() await LaunchAgentController().install()
// Wait a second for launchd to kick in (next runloop isn't enough). // Wait a second for launchd to kick in (next runloop isn't enough).
await Task.sleep(UInt64(Measurement(value: 1, unit: UnitDuration.seconds).converted(to: .nanoseconds).value)) try? await Task.sleep(nanoseconds: UInt64(Measurement(value: 1, unit: UnitDuration.seconds).converted(to: .nanoseconds).value))
agentStatusChecker.check() agentStatusChecker.check()
if !agentStatusChecker.running { if !agentStatusChecker.running {
forceLaunchAgent() forceLaunchAgent()

View File

@ -12,7 +12,7 @@ struct LaunchAgentController {
// This is definitely a bit of a "seems to work better" thing but: // This is definitely a bit of a "seems to work better" thing but:
// Seems to more reliably hit if these are on separate runloops, otherwise it seems like it sometimes doesn't kill old // Seems to more reliably hit if these are on separate runloops, otherwise it seems like it sometimes doesn't kill old
// and start new? // and start new?
await Task.sleep(UInt64(Measurement(value: 0.1, unit: UnitDuration.seconds).converted(to: .nanoseconds).value)) try? await Task.sleep(nanoseconds: UInt64(Measurement(value: 0.1, unit: UnitDuration.seconds).converted(to: .nanoseconds).value))
_ = setEnabled(true) _ = setEnabled(true)
} }