Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Elixxir dApps SDK Swift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
Elixxir dApps SDK Swift
Merge requests
!38
Fix sleep interval in MessengerWaitForNodes
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix sleep interval in MessengerWaitForNodes
fix/messener-wait-for-nodes-sleep
into
development
Overview
0
Commits
1
Pipelines
0
Changes
3
Merged
Dariusz Rybicki
requested to merge
fix/messener-wait-for-nodes-sleep
into
development
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
3
Expand
0
0
Merge request reports
Compare
development
development (base)
and
latest version
latest version
abd0401f
1 commit,
2 years ago
3 files
+
13
−
12
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
Sources/XXMessengerClient/Messenger/Functors/MessengerWaitForNodes.swift
+
6
−
5
Options
import
Foundation
import
XXClient
import
XCTestDynamicOverlay
@@ -9,21 +10,21 @@ public struct MessengerWaitForNodes {
case
timeout
}
public
var
run
:
(
Double
,
Int
,
Int
,
@escaping
Progress
)
throws
->
Void
public
var
run
:
(
Double
,
TimeInterval
,
Int
,
@escaping
Progress
)
throws
->
Void
public
func
callAsFunction
(
targetRatio
:
Double
=
0.8
,
sleep
MS
:
Int
=
1_000
,
sleep
Interval
:
TimeInterval
=
1
,
retries
:
Int
=
10
,
onProgress
:
@escaping
Progress
=
{
_
in
}
)
throws
{
try
run
(
targetRatio
,
sleep
MS
,
retries
,
onProgress
)
try
run
(
targetRatio
,
sleep
Interval
,
retries
,
onProgress
)
}
}
extension
MessengerWaitForNodes
{
public
static
func
live
(
_
env
:
MessengerEnvironment
)
->
MessengerWaitForNodes
{
MessengerWaitForNodes
{
targetRatio
,
sleep
MS
,
retries
,
onProgress
in
MessengerWaitForNodes
{
targetRatio
,
sleep
Interval
,
retries
,
onProgress
in
guard
let
cMix
=
env
.
cMix
()
else
{
throw
Error
.
notLoaded
}
@@ -33,7 +34,7 @@ extension MessengerWaitForNodes {
onProgress
(
report
)
while
report
.
ratio
<
targetRatio
&&
retries
>
0
{
env
.
sleep
(
sleep
MS
)
env
.
sleep
(
sleep
Interval
)
report
=
try
cMix
.
getNodeRegistrationStatus
()
retries
-=
1
onProgress
(
report
)
Loading