Skip to content

Commit

Permalink
Move around HWM. We were missing the last message
Browse files Browse the repository at this point in the history
  • Loading branch information
elffjs committed Nov 6, 2024
1 parent a7e2af3 commit c0a02b1
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions cmd/devices-api/find_old_style_tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,28 @@ func (fost *findOldStyleTasks) Execute(_ context.Context, _ *flag.FlagSet, _ ...
}

for m := range pc.Messages() {
if m.Offset >= hwm-1 {
break
}

key := string(m.Key)

if m.Value == nil {
delete(missing, key)
continue
}
} else {

var out shared.CloudEvent[sdtask.CredentialData]
var out shared.CloudEvent[sdtask.CredentialData]

err := json.Unmarshal(m.Value, &out)
if err != nil {
panic(err)
err := json.Unmarshal(m.Value, &out)
if err != nil {
panic(err)
}

if out.Data.SyntheticDevice == nil {
missing[key] = out
} else {
delete(missing, key)
}
}

if out.Data.SyntheticDevice == nil {
missing[key] = out
} else {
delete(missing, key)
if m.Offset >= hwm-1 {
break
}
}

Expand Down

0 comments on commit c0a02b1

Please sign in to comment.