Skip to content

Commit 242e391

Browse files
author
Thibault Wittemberg
committed
timer: finish on cancel
1 parent 6d3d520 commit 242e391

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/AsyncSequences/AsyncSequences+Timer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public class AsyncTimerSequence: AsyncSequence {
5858
try await Task.sleep(nanoseconds: interval.value)
5959
continuation.yield(Date())
6060
}
61+
continuation.finish()
6162
} catch is CancellationError {
6263
continuation.finish()
6364
} catch {

0 commit comments

Comments
 (0)