From 489efec3f7d626ea76f6c0c4b457ac098eefc14d Mon Sep 17 00:00:00 2001 From: Mukund Ananthu Date: Thu, 18 Apr 2024 22:13:20 +0000 Subject: [PATCH 1/2] testing: Sync modack inlib --- .../subscriber/_protocol/streaming_pull_manager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py b/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py index f07db8546..8b67e9f1a 100644 --- a/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py +++ b/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py @@ -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, @@ -1074,6 +1075,11 @@ def _on_response(self, response: gapic_types.StreamingPullResponse) -> None: # IMPORTANT: Circumvent the wrapper class and operate on the raw underlying # 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).", From b6333b1006d9b37f5f1ae69a91e2df4c9ce9387e Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 18 Apr 2024 22:16:41 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../pubsub_v1/subscriber/_protocol/streaming_pull_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py b/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py index 8b67e9f1a..d26418cab 100644 --- a/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py +++ b/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py @@ -1075,7 +1075,7 @@ def _on_response(self, response: gapic_types.StreamingPullResponse) -> None: # IMPORTANT: Circumvent the wrapper class and operate on the raw underlying # 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: