Skip to content

fix(pubsub): convert stream ack deadline seconds from duration#11214

Merged
hongalex merged 3 commits intogoogleapis:mainfrom
hongalex:fix-pubsub-stream-deadline
Dec 4, 2024
Merged

fix(pubsub): convert stream ack deadline seconds from duration#11214
hongalex merged 3 commits intogoogleapis:mainfrom
hongalex:fix-pubsub-stream-deadline

Conversation

@hongalex
Copy link
Member

@hongalex hongalex commented Dec 3, 2024

Fixes #10557

@hongalex hongalex requested a review from shollyman as a code owner December 3, 2024 19:59
@hongalex hongalex requested review from a team December 3, 2024 19:59
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Dec 3, 2024
it.eoMu.RLock()
if it.sendNewAckDeadline {
spr.StreamAckDeadlineSeconds = int32(it.ackDeadline())
spr.StreamAckDeadlineSeconds = int32(it.ackDeadline()) / int32(time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be more readable to use https://pkg.go.dev/time#Duration.Seconds and cast from there, rather than doing unit division.

@hongalex hongalex enabled auto-merge (squash) December 4, 2024 20:50
@hongalex hongalex merged commit b2b05e4 into googleapis:main Dec 4, 2024
@hongalex hongalex deleted the fix-pubsub-stream-deadline branch December 10, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API.

2 participants