refactor: null safety, update date/time libraries, and migrate tests (#4900)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-03-23 18:17:50 -05:00 committed by GitHub
parent f826cac6c8
commit 664ebf218e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
163 changed files with 503 additions and 4993 deletions

View file

@ -43,19 +43,18 @@ class SequentialJob {
*/
fun launch(scope: CoroutineScope, timeoutMs: Long = 0, block: suspend CoroutineScope.() -> Unit) {
cancel()
val newJob =
scope.handledLaunch {
if (timeoutMs > 0) {
try {
withTimeout(timeoutMs, block)
} catch (e: TimeoutCancellationException) {
Logger.w { "SequentialJob timed out after ${timeoutMs}ms" }
throw e
}
} else {
block()
val newJob = scope.handledLaunch {
if (timeoutMs > 0) {
try {
withTimeout(timeoutMs, block)
} catch (e: TimeoutCancellationException) {
Logger.w { "SequentialJob timed out after ${timeoutMs}ms" }
throw e
}
} else {
block()
}
}
job.value = newJob
newJob.invokeOnCompletion { job.compareAndSet(newJob, null) }