@@ -311,11 +311,10 @@ async def process(self, event):
311
311
"""
312
312
:type event: Event
313
313
"""
314
- run_before_tasks = []
315
314
tasks = []
316
315
halted = False
317
316
318
- def add_hook (hook , _event , _run_before = False ):
317
+ def add_hook (hook , _event ):
319
318
nonlocal halted
320
319
if halted :
321
320
return False
@@ -324,10 +323,7 @@ def add_hook(hook, _event, _run_before=False):
324
323
return True
325
324
326
325
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 )
331
327
332
328
if hook .action is Action .HALTALL :
333
329
halted = True
@@ -340,10 +336,8 @@ def add_hook(hook, _event, _run_before=False):
340
336
341
337
# Raw IRC hook
342
338
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
345
339
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 )
347
341
):
348
342
# The hook has an action of Action.HALT* so stop adding new tasks
349
343
break
@@ -424,5 +418,4 @@ def add_hook(hook, _event, _run_before=False):
424
418
break
425
419
426
420
# Run the tasks
427
- await asyncio .gather (* run_before_tasks , loop = self .loop )
428
421
await asyncio .gather (* tasks , loop = self .loop )
0 commit comments