Skip to content

Commit

Permalink
filter for only the plugin that was changed/updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mbiannaccone committed Nov 5, 2024
1 parent c4efe1a commit 148aab7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugin_runner/plugin_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,15 @@ def __init__(self) -> None:
async def HandleEvent(self, request: Event, context: Any) -> EventResponse:
"""This is invoked when an event comes in."""
event_start_time = time.time()
event_name = EventType.Name(request.type)
event_type = request.type
event_name = EventType.Name(event_type)
relevant_plugins = EVENT_PROTOCOL_MAP.get(event_name, [])

if event_type in [EventType.PLUGIN_CREATED, EventType.PLUGIN_UPDATED]:
plugin_name = request.target
# filter only for the plugin(s) that were created/updated
relevant_plugins = [p for p in relevant_plugins if p.startswith(f"{plugin_name}:")]

effect_list = []

for plugin_name in relevant_plugins:
Expand Down

0 comments on commit 148aab7

Please sign in to comment.