Skip to content

Commit

Permalink
moved runId creation to k.GetRunID()
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarfda committed Oct 31, 2024
1 parent 5284a22 commit 763b574
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/launcher/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func runLauncher(ctx context.Context, cancel func(), multiSlogger, systemMultiSl
k := knapsack.New(stores, flagController, db, multiSlogger, systemMultiSlogger)

// Generate a new run ID
newRunID := ulid.New()
newRunID := k.GetRunID()
// Set the run ID in knapsack
k.SetRunID(newRunID)

Expand Down
4 changes: 4 additions & 0 deletions ee/agent/knapsack/knapsack.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"log/slog"

"github.com/kolide/kit/ulid"
"github.com/kolide/launcher/ee/agent/storage"
"github.com/kolide/launcher/ee/agent/types"
"github.com/kolide/launcher/ee/tuf"
Expand Down Expand Up @@ -71,6 +72,9 @@ func (k *knapsack) SetRunID(id string) {

// GetRunID retrieves the run ID from the knapsack
func (k *knapsack) GetRunID() string {
if runID == "" {
runID = ulid.New()
}
return runID
}

Expand Down

0 comments on commit 763b574

Please sign in to comment.