Skip to content

Commit

Permalink
pub_sub: go: set publisher sleep to 1 second
Browse files Browse the repository at this point in the history
The current implementation calls `time.Sleep(1000)` with untyped
literal `1000`, which is interpreted as 1000 nanoseconds, or 1
millisecond.

This commit changes the sleep duration to proper typed constant
`time.Second`, which corresponds to the sleep time of other
language examples.

Signed-off-by: Paško Zdilar <[email protected]>
  • Loading branch information
paskozdilar committed Jul 27, 2023
1 parent dfde545 commit 8962584
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pub_sub/go/http/checkout/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ func main() {

fmt.Println("Published data:", order)

time.Sleep(1000)
time.Sleep(time.Second)
}
}
2 changes: 1 addition & 1 deletion pub_sub/go/sdk/checkout/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ func main() {

fmt.Println("Published data:", order)

time.Sleep(1000)
time.Sleep(time.Second)
}
}

0 comments on commit 8962584

Please sign in to comment.