mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-04 22:43:12 +00:00
Remove new implementation of eventuallySafe by overidding the default params of eventually
With this fix in, there is no need to use the asynctest update that sets longer defaults for eventually, so downgrade asynctest
This commit is contained in:
parent
0fca36344f
commit
61b45bb921
@ -4,6 +4,8 @@ import helpers/templeveldb
|
||||
import std/times
|
||||
import std/sequtils, chronos
|
||||
|
||||
import ./asynctest
|
||||
|
||||
export multisetup, trackers, templeveldb
|
||||
|
||||
### taken from libp2p errorhelpers.nim
|
||||
@ -36,13 +38,7 @@ proc allFuturesThrowing*[T, E]( # https://github.com/nim-lang/Nim/issues/23432
|
||||
): Future[void] =
|
||||
allFuturesThrowing(futs.mapIt(FutureBase(it)))
|
||||
|
||||
template eventuallySafe*(expression: untyped, timeout=5000, pollInterval=1000)): bool =
|
||||
proc eventuallySafe(): Future[bool] {.async.} =
|
||||
let endTime = getTime() + initDuration(milliseconds = timeout)
|
||||
while not expression:
|
||||
if endTime < getTime():
|
||||
return false
|
||||
await sleepAsync(pollInterval)
|
||||
return true
|
||||
|
||||
await eventuallySafe()
|
||||
template eventuallySafe*(
|
||||
expression: untyped, timeout = 5000, pollInterval = 1000
|
||||
): bool =
|
||||
eventually(expression, timeout, pollInterval)
|
||||
|
||||
2
vendor/asynctest
vendored
2
vendor/asynctest
vendored
@ -1 +1 @@
|
||||
Subproject commit 73c08f77afc5cc2a5628d00f915b97bf72f70c9b
|
||||
Subproject commit 32df0f19d6e0e6f84c762cf8de7361ddb419f4ba
|
||||
Loading…
x
Reference in New Issue
Block a user