@@ -311,11 +311,10 @@ async def process(self, event):
311311 """
312312 :type event: Event
313313 """
314- run_before_tasks = []
315314 tasks = []
316315 halted = False
317316
318- def add_hook (hook , _event , _run_before = False ):
317+ def add_hook (hook , _event ):
319318 nonlocal halted
320319 if halted :
321320 return False
@@ -324,10 +323,7 @@ def add_hook(hook, _event, _run_before=False):
324323 return True
325324
326325 coro = self .plugin_manager .launch (hook , _event )
327- if _run_before :
328- run_before_tasks .append (coro )
329- else :
330- tasks .append (coro )
326+ tasks .append (coro )
331327
332328 if hook .action is Action .HALTALL :
333329 halted = True
@@ -340,10 +336,8 @@ def add_hook(hook, _event, _run_before=False):
340336
341337 # Raw IRC hook
342338 for raw_hook in self .plugin_manager .catch_all_triggers :
343- # run catch-all coroutine hooks before all others - TODO: Make this a plugin argument
344- run_before = not raw_hook .threaded
345339 if not add_hook (
346- raw_hook , Event (hook = raw_hook , base_event = event ), _run_before = run_before
340+ raw_hook , Event (hook = raw_hook , base_event = event )
347341 ):
348342 # The hook has an action of Action.HALT* so stop adding new tasks
349343 break
@@ -424,5 +418,4 @@ def add_hook(hook, _event, _run_before=False):
424418 break
425419
426420 # Run the tasks
427- await asyncio .gather (* run_before_tasks , loop = self .loop )
428421 await asyncio .gather (* tasks , loop = self .loop )
0 commit comments