mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 07:08:10 +00:00
perf: fast path for sync hooks
This commit is contained in:
parent
6dc6269b8e
commit
068204fc59
@ -264,7 +264,7 @@ class AddonManager:
|
||||
for addon, func in self._iter_hooks(addon, event):
|
||||
res = func(*event.args())
|
||||
# Support both async and sync hook functions
|
||||
if inspect.isawaitable(res):
|
||||
if res is not None and inspect.isawaitable(res):
|
||||
await res
|
||||
|
||||
def invoke_addon_sync(self, addon, event: hooks.Hook):
|
||||
|
Loading…
Reference in New Issue
Block a user