Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
e50abcc4
Commit
e50abcc4
authored
Oct 12, 2021
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
gotta go fast
parent
942d1ca6
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!53
Release
,
!40
Hotfixes
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/root.go
+32
-27
32 additions, 27 deletions
cmd/root.go
with
32 additions
and
27 deletions
cmd/root.go
+
32
−
27
View file @
e50abcc4
...
@@ -12,6 +12,7 @@ import (
...
@@ -12,6 +12,7 @@ import (
"encoding/base64"
"encoding/base64"
"encoding/binary"
"encoding/binary"
"encoding/hex"
"encoding/hex"
"errors"
"fmt"
"fmt"
"github.com/spf13/cobra"
"github.com/spf13/cobra"
jww
"github.com/spf13/jwalterweatherman"
jww
"github.com/spf13/jwalterweatherman"
...
@@ -188,8 +189,9 @@ var rootCmd = &cobra.Command{
...
@@ -188,8 +189,9 @@ var rootCmd = &cobra.Command{
paramsUnsafe
:=
params
.
GetDefaultUnsafe
()
paramsUnsafe
:=
params
.
GetDefaultUnsafe
()
sendCnt
:=
int
(
viper
.
GetUint
(
"sendCount"
))
sendCnt
:=
int
(
viper
.
GetUint
(
"sendCount"
))
sendDelay
:=
time
.
Duration
(
viper
.
GetUint
(
"sendDelay"
))
//
sendDelay := time.Duration(viper.GetUint("sendDelay"))
for
i
:=
0
;
i
<
sendCnt
;
i
++
{
for
i
:=
0
;
i
<
sendCnt
;
i
++
{
go
func
(){
fmt
.
Printf
(
"Sending to %s: %s
\n
"
,
recipientID
,
msgBody
)
fmt
.
Printf
(
"Sending to %s: %s
\n
"
,
recipientID
,
msgBody
)
var
roundIDs
[]
id
.
Round
var
roundIDs
[]
id
.
Round
var
roundTimeout
time
.
Duration
var
roundTimeout
time
.
Duration
...
@@ -213,12 +215,15 @@ var rootCmd = &cobra.Command{
...
@@ -213,12 +215,15 @@ var rootCmd = &cobra.Command{
}
}
// Have the client report back the round results
// Have the client report back the round results
err
=
errors
.
New
(
"derp"
)
for
j
:=
0
;
j
<
5
&&
err
!=
nil
;
j
++
{
err
=
client
.
GetRoundResults
(
roundIDs
,
roundTimeout
,
f
)
err
=
client
.
GetRoundResults
(
roundIDs
,
roundTimeout
,
f
)
}
if
err
!=
nil
{
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"%+v"
,
err
)
jww
.
FATAL
.
Panicf
(
"%+v"
,
err
)
}
}
}()
time
.
Sleep
(
sendDelay
*
time
.
Millisecond
)
}
}
// Wait until message timeout or we receive enough then exit
// Wait until message timeout or we receive enough then exit
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment