Skip to content

Commit

Permalink
fix random number generator
Browse files Browse the repository at this point in the history
  • Loading branch information
AchoArnold committed Oct 10, 2023
1 parent 6bc3ec5 commit f97f0ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/pkg/services/message_thread_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ func (service *MessageThreadService) getColor() string {
"deep-orange",
"brown",
}
rand.Seed(time.Now().UnixNano())
return colors[rand.Intn(len(colors))]
generator := rand.New(rand.NewSource(time.Now().UnixNano()))
return colors[generator.Intn(len(colors))]
}

// MessageThreadGetParams parameters fetching threads
Expand Down

0 comments on commit f97f0ef

Please sign in to comment.