-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data race in static Kronos.Clock.annotatedNow.getter #85
Comments
So technically right now we expect you to call |
Hey 👋 This issue has been reported on our side as well, see dd-sdk-ios/#588. Is it right to say that I think Kronos could benefit from 2 changes:
public static func sync(from pool: String = "time.apple.com", samples: Int = 4,
queue: DispatchQueue = .main,
first: ((Date, TimeInterval) -> Void)? = nil,
completion: ((Date?, TimeInterval?) -> Void)? = nil)
{
self.loadFromDefaults()
NTPClient().query(pool: pool, numberOfSamples: samples) { offset, done, total in
queue.async {
if let offset = offset {
self.stableTime = TimeFreeze(offset: offset)
if done == 1, let now = self.now {
first?(now, offset)
}
}
if done == total {
completion?(self.now, offset)
}
}
}
}
Would this make sense? |
The text was updated successfully, but these errors were encountered: