Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yetus: Remove calls to rand.Seed() #3747

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions pkg/pillar/execlib/execlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,7 @@ func New(ps *pubsub.PubSub, log *base.LogObject, agentName string, executor stri
})
pubExecConfig.Unpublish(agentName)

// Start with a random number in case the process as run before
// and used some sequence
now := time.Now()
_, _, seed := now.Clock()
seed += now.Nanosecond()
rand.Seed(int64(seed))
// No need to use rand.Seed() any more
sequence := rand.Int()

handle := ExecuteHandle{
Expand Down
4 changes: 0 additions & 4 deletions pkg/pillar/tgt/tgt.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ const (
naaPrefix = "5001405" // from rtslib-fb
)

func init() {
rand.Seed(time.Now().UnixNano())
}

func waitForFile(fileName string) error {
maxDelay := time.Second * 5
delay := time.Millisecond * 500
Expand Down
Loading