Skip to content

Commit

Permalink
Fix starting paused Hunts setting expires & timestamp to 0 (#157)
Browse files Browse the repository at this point in the history
Fixes issues where users were starting paused Hunts and having them
immediately stopped due to `expires` being set to 0 when updating the
OpenSearch document to change the hunt status.

`timestamp` was also being set to 0, included a fix to prevent this as
well.
  • Loading branch information
smccooey-r7 authored Jan 15, 2025
1 parent 2eb16b3 commit b25ad60
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions services/hunt_dispatcher/hunt_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ func (self HuntDispatcher) SetHunt(hunt *api_proto.Hunt) error {
}

record := &HuntEntry{
HuntId: hunt_id,
Hunt: string(serialized),
State: hunt.State.String(),
DocType: "hunts",
HuntId: hunt_id,
Timestamp: int64(hunt.CreateTime / 1000000),
Expires: hunt.Expires,
Hunt: string(serialized),
State: hunt.State.String(),
DocType: "hunts",
}

if hunt.Stats != nil {
Expand Down

0 comments on commit b25ad60

Please sign in to comment.