@@ -300,11 +300,10 @@ async def process(self, event):
300
300
"""
301
301
:type event: Event
302
302
"""
303
- run_before_tasks = []
304
303
tasks = []
305
304
halted = False
306
305
307
- def add_hook (hook , _event , _run_before = False ):
306
+ def add_hook (hook , _event ):
308
307
nonlocal halted
309
308
if halted :
310
309
return False
@@ -313,10 +312,7 @@ def add_hook(hook, _event, _run_before=False):
313
312
return True
314
313
315
314
coro = self .plugin_manager .launch (hook , _event )
316
- if _run_before :
317
- run_before_tasks .append (coro )
318
- else :
319
- tasks .append (coro )
315
+ tasks .append (coro )
320
316
321
317
if hook .action is Action .HALTALL :
322
318
halted = True
@@ -329,9 +325,7 @@ def add_hook(hook, _event, _run_before=False):
329
325
330
326
# Raw IRC hook
331
327
for raw_hook in self .plugin_manager .catch_all_triggers :
332
- # run catch-all coroutine hooks before all others - TODO: Make this a plugin argument
333
- run_before = not raw_hook .threaded
334
- if not add_hook (raw_hook , Event (hook = raw_hook , base_event = event ), _run_before = run_before ):
328
+ if not add_hook (raw_hook , Event (hook = raw_hook , base_event = event )):
335
329
# The hook has an action of Action.HALT* so stop adding new tasks
336
330
break
337
331
@@ -403,5 +397,4 @@ def add_hook(hook, _event, _run_before=False):
403
397
break
404
398
405
399
# Run the tasks
406
- await asyncio .gather (* run_before_tasks , loop = self .loop )
407
400
await asyncio .gather (* tasks , loop = self .loop )
0 commit comments