File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,6 +208,14 @@ fn configure_wait_stream(
208208 case mode {
209209 MaxAttempts ( max_attempts ) -> wait_stream |> yielder . take ( max_attempts )
210210 Expiry ( _ ) -> wait_stream
211+
212+ fn duration_ms( left: Timestamp, right : Timestamp) -> Int {
213+ left
214+ |> timestamp . difference ( right )
215+ |> duration . to_seconds_and_nanoseconds
216+ |> fn ( seconds_nanoseconds ) {
217+ let # ( seconds , nanoseconds ) = seconds_nanoseconds
218+ seconds * 1000 + nanoseconds / 1_000_000
211219 }
212220}
213221
@@ -233,16 +241,7 @@ fn do_execute(
233241 True , yielder . Next ( wait_time , wait_stream ) -> {
234242 wait_function ( wait_time )
235243 let wait_time_acc = [ wait_time , .. wait_time_acc ]
236-
237- let duration =
238- start_time
239- |> timestamp . difference ( clock . now ( clock ) )
240- |> duration . to_seconds_and_nanoseconds
241- |> fn ( seconds_nanoseconds ) {
242- let # ( seconds , nanoseconds ) = seconds_nanoseconds
243- let milliseconds = seconds * 1000 + nanoseconds / 1_000_000
244- milliseconds
245- }
244+ let duration = duration_ms ( start_time , clock . now ( clock ) )
246245
247246 case operation ( attempt ) {
248247 Ok ( result ) ->
You can’t perform that action at this time.
0 commit comments