Skip to content

fix: separate plugin chain cache based on whether a plugin needs to be skipped or not #916

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

Merged
merged 1 commit into from
Jul 14, 2025
Merged
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
5 changes: 3 additions & 2 deletions aws_advanced_python_wrapper/plugin_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,10 +901,11 @@ def _execute_with_subscribed_plugins(
plugin_func: Callable,
target_driver_func: Callable,
plugin_to_skip: Optional[Plugin] = None):
pipeline_func: Optional[Callable] = self._function_cache.get(method_name)
cache_key = method_name if plugin_to_skip is None else method_name + plugin_to_skip.__class__.__name__
pipeline_func: Optional[Callable] = self._function_cache.get(cache_key)
if pipeline_func is None:
pipeline_func = self._make_pipeline(method_name, plugin_to_skip)
self._function_cache[method_name] = pipeline_func
self._function_cache[cache_key] = pipeline_func

return pipeline_func(plugin_func, target_driver_func)

Expand Down