|
7 | 7 |
|
8 | 8 | from typing import Callable, Type, Union |
9 | 9 | from urllib.parse import urlparse |
10 | | -from collections import MutableMapping |
11 | | -from contextlib import suppress |
12 | 10 |
|
13 | 11 | from ...connections.models.connection_target import ConnectionTarget |
14 | 12 | from ...core.profile import Profile |
|
27 | 25 | ) |
28 | 26 | from .message import OutboundMessage |
29 | 27 |
|
30 | | -from .constants import REMOVE_KEY |
31 | | - |
32 | 28 | LOGGER = logging.getLogger(__name__) |
33 | 29 | MODULE_BASE_PATH = "aries_cloudagent.transport.outbound" |
34 | 30 |
|
@@ -91,13 +87,10 @@ def __init__(self, profile: Profile, handle_not_delivered: Callable = None): |
91 | 87 | self.running_transports = {} |
92 | 88 | self.task_queue = TaskQueue(max_active=200) |
93 | 89 | self._process_task: asyncio.Task = None |
94 | | - self.light_webhook = False |
95 | 90 | if self.root_profile.settings.get("transport.max_outbound_retry"): |
96 | 91 | self.MAX_RETRY_COUNT = self.root_profile.settings[ |
97 | 92 | "transport.max_outbound_retry" |
98 | 93 | ] |
99 | | - if self.root_profile.settings.get("transport.light_weight_webhook"): |
100 | | - self.light_webhook = True |
101 | 94 |
|
102 | 95 | async def setup(self): |
103 | 96 | """Perform setup operations.""" |
@@ -316,14 +309,6 @@ async def encode_outbound_message( |
316 | 309 |
|
317 | 310 | return outbound_message |
318 | 311 |
|
319 | | - def delete_keys_from_dict(self, dictionary, keys): |
320 | | - for key in keys: |
321 | | - with suppress(KeyError): |
322 | | - del dictionary[key] |
323 | | - for value in dictionary.values(): |
324 | | - if isinstance(value, MutableMapping): |
325 | | - self.delete_keys_from_dict(value, keys) |
326 | | - |
327 | 312 | def enqueue_webhook( |
328 | 313 | self, |
329 | 314 | topic: str, |
@@ -358,10 +343,6 @@ def enqueue_webhook( |
358 | 343 | queued.payload = json.dumps(payload) |
359 | 344 | queued.state = QueuedOutboundMessage.STATE_PENDING |
360 | 345 | queued.retries = 4 if max_attempts is None else max_attempts - 1 |
361 | | - |
362 | | - if self.light_webhook: |
363 | | - self.delete_keys_from_dict(payload, REMOVE_KEY) |
364 | | - queued.payload = json.dumps(payload) |
365 | 346 | self.outbound_new.append(queued) |
366 | 347 | self.process_queued() |
367 | 348 |
|
|
0 commit comments