Skip to content

Commit

Permalink
fix: update session timed out error to be non-blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
phantumcode committed Oct 20, 2023
1 parent 1ea01cb commit c16f424
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ extension FaceLivenessDetectionViewModel: FaceDetectionResultHandler {
noFitStartTime = Date()
}
if let elapsedTime = noFitStartTime?.timeIntervalSinceNow, abs(elapsedTime) >= noFitTimeoutInterval {
self.livenessState
.unrecoverableStateEncountered(.timedOut)
self.captureSession.stopRunning()
DispatchQueue.main.async {
self.livenessState
.unrecoverableStateEncountered(.timedOut)
self.captureSession.stopRunning()
}
}
}

Expand All @@ -100,9 +102,11 @@ extension FaceLivenessDetectionViewModel: FaceDetectionResultHandler {
noFitStartTime = Date()
}
if let elapsedTime = noFitStartTime?.timeIntervalSinceNow, abs(elapsedTime) >= noFitTimeoutInterval {
self.livenessState
.unrecoverableStateEncountered(.timedOut)
self.captureSession.stopRunning()
DispatchQueue.main.async {
self.livenessState
.unrecoverableStateEncountered(.timedOut)
self.captureSession.stopRunning()
}
}
}

Expand Down

0 comments on commit c16f424

Please sign in to comment.