Skip to content
Snippets Groups Projects
Commit 30fdcee9 authored by Josh Brooks's avatar Josh Brooks
Browse files

Add more fixes

parent 9909d901
Branches
Tags
4 merge requests!510Release,!212Replace usage of manager with interface and add services,!211Xx 3886/udb integration,!207WIP: Client Restructure
...@@ -240,7 +240,9 @@ func (t *manager) track(stop *stoppable.Single) { ...@@ -240,7 +240,9 @@ func (t *manager) track(stop *stoppable.Single) {
func (t *manager) processIdentities(addressSize uint8) time.Time { func (t *manager) processIdentities(addressSize uint8) time.Time {
edits := false edits := false
toRemove := make(map[int]struct{}) toRemove := make(map[int]struct{})
nextEvent := t.tracked[0].ValidUntil // Identities are rotated on a 24-hour time period. Set the event
// to the latest possible time so that any sooner times will overwrite this
nextEvent := netTime.Now().Add(time.Duration(ephemeral.Period))
// Loop through every tracked ID and see if any operations are needed // Loop through every tracked ID and see if any operations are needed
for i, inQuestion := range t.tracked { for i, inQuestion := range t.tracked {
...@@ -263,13 +265,15 @@ func (t *manager) processIdentities(addressSize uint8) time.Time { ...@@ -263,13 +265,15 @@ func (t *manager) processIdentities(addressSize uint8) time.Time {
if inQuestion.NextGeneration.Before(nextEvent) { if inQuestion.NextGeneration.Before(nextEvent) {
nextEvent = inQuestion.NextGeneration nextEvent = inQuestion.NextGeneration
} }
if inQuestion.ValidUntil != Forever && inQuestion.ValidUntil.Before(nextEvent) { if !inQuestion.ValidUntil.IsZero() && inQuestion.ValidUntil.Before(nextEvent) {
nextEvent = inQuestion.ValidUntil nextEvent = inQuestion.ValidUntil
} }
} }
} }
jww.INFO.Printf("[TrackedIDS] NextEvent: %s", nextEvent)
// Process any deletions // Process any deletions
if len(toRemove) > 0 { if len(toRemove) > 0 {
newTracked := make([]TrackedID, 0, len(t.tracked)) newTracked := make([]TrackedID, 0, len(t.tracked))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment