Skip to content

Commit

Permalink
Remove unnecessary sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuratczyk committed Oct 4, 2023
1 parent e38d078 commit c0960c9
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pkg/stomp_client/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ type StompPublisher struct {
}

func NewPublisher(cfg config.Config, id int) *StompPublisher {
// sleep random interval to avoid all publishers publishing at exactly the same time
s := rand.Intn(cfg.Publishers)
time.Sleep(time.Duration(s) * time.Millisecond)

conn, err := stomp.Dial("tcp", cfg.PublisherUri, opts...)
if err != nil {
log.Error("publisher connection failed", "protocol", "STOMP", "publisherId", id, "error", err.Error())
Expand Down

0 comments on commit c0960c9

Please sign in to comment.