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

testing: Sync modack inlib #1148

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from google.cloud.pubsub_v1.subscriber._protocol import leaser
from google.cloud.pubsub_v1.subscriber._protocol import messages_on_hold
from google.cloud.pubsub_v1.subscriber._protocol import requests
from google.protobuf.timestamp_pb2 import Timestamp
from google.cloud.pubsub_v1.subscriber.exceptions import (
AcknowledgeError,
AcknowledgeStatus,
Expand Down Expand Up @@ -1075,6 +1076,11 @@ def _on_response(self, response: gapic_types.StreamingPullResponse) -> None:
# protobuf message to significantly gain on attribute access performance.
received_messages = response._pb.received_messages

current_time = Timestamp()
current_time.GetCurrentTime()
for rm in received_messages:
rm.message.publish_time.CopyFrom(current_time)

_LOGGER.debug(
"Processing %s received message(s), currently on hold %s (bytes %s).",
len(received_messages),
Expand Down
Loading