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
01a4c858
Commit
01a4c858
authored
Apr 22, 2022
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
Add debug prints to cmix/identity/manager.track when a new identity is added
parent
45bfa35f
No related branches found
No related tags found
3 merge requests
!510
Release
,
!207
WIP: Client Restructure
,
!203
Symmetric broadcast
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmix/identity/tracker.go
+7
-1
7 additions, 1 deletion
cmix/identity/tracker.go
with
7 additions
and
1 deletion
cmix/identity/tracker.go
+
7
−
1
View file @
01a4c858
...
@@ -189,13 +189,18 @@ func (t *manager) track(stop *stoppable.Single) {
...
@@ -189,13 +189,18 @@ func (t *manager) track(stop *stoppable.Single) {
// Sleep until the last ID has expired
// Sleep until the last ID has expired
select
{
select
{
case
<-
time
.
NewTim
er
(
nextUpdate
.
Sub
(
nextUpdate
))
.
C
:
case
<-
time
.
Aft
er
(
nextUpdate
.
Sub
(
nextUpdate
))
:
case
newIdentity
:=
<-
t
.
newIdentity
:
case
newIdentity
:=
<-
t
.
newIdentity
:
jww
.
DEBUG
.
Printf
(
"Receiving new identity %s :%+v"
,
newIdentity
.
Source
,
newIdentity
)
// If the identity is old, then update its properties
// If the identity is old, then update its properties
isOld
:=
false
isOld
:=
false
for
i
:=
range
t
.
tracked
{
for
i
:=
range
t
.
tracked
{
inQuestion
:=
t
.
tracked
[
i
]
inQuestion
:=
t
.
tracked
[
i
]
if
inQuestion
.
Source
.
Cmp
(
newIdentity
.
Source
)
{
if
inQuestion
.
Source
.
Cmp
(
newIdentity
.
Source
)
{
jww
.
DEBUG
.
Printf
(
"Updating old identity %s"
,
newIdentity
.
Source
)
inQuestion
.
Persistent
=
newIdentity
.
Persistent
inQuestion
.
Persistent
=
newIdentity
.
Persistent
inQuestion
.
ValidUntil
=
newIdentity
.
ValidUntil
inQuestion
.
ValidUntil
=
newIdentity
.
ValidUntil
isOld
=
true
isOld
=
true
...
@@ -203,6 +208,7 @@ func (t *manager) track(stop *stoppable.Single) {
...
@@ -203,6 +208,7 @@ func (t *manager) track(stop *stoppable.Single) {
}
}
}
}
if
!
isOld
{
if
!
isOld
{
jww
.
DEBUG
.
Printf
(
"Tracking new identity %s"
,
newIdentity
.
Source
)
// Otherwise, add it to the list and run
// Otherwise, add it to the list and run
t
.
tracked
=
append
(
t
.
tracked
,
newIdentity
)
t
.
tracked
=
append
(
t
.
tracked
,
newIdentity
)
}
}
...
...
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