Skip to content

Commit 7931780

Browse files
committed
fix: removed Thread.sleep from inspect function
1 parent 2959b03 commit 7931780

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

BDKSwiftExampleWallet/Actor/WalletSyncScriptInspector.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ actor WalletSyncScriptInspector: @preconcurrency SyncScriptInspector {
3131
} else {
3232
0
3333
}
34-
Thread.sleep(forTimeInterval: delay)
35-
updateProgress(inspectedCount, totalCount)
34+
if delay > 0 {
35+
Task {
36+
try? await Task.sleep(nanoseconds: UInt64(delay * 1_000_000_000))
37+
updateProgress(inspectedCount, totalCount)
38+
}
39+
} else {
40+
updateProgress(inspectedCount, totalCount)
41+
}
3642
}
3743
}

0 commit comments

Comments
 (0)