File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
30
30
- Fix FML random URL
31
31
- Update tvdb.py to v3 TVDB API
32
32
- Fix channel parameter handling in IRC client
33
+ - Ensure hooks are triggered according to priority
33
34
### Removed
34
35
- twitch.py removed due to outdated API and lack of maintainer
35
36
- metacritic.py removed due to broken scraper and lack of maintainer
Original file line number Diff line number Diff line change @@ -322,8 +322,7 @@ def add_hook(hook, _event):
322
322
if hook .clients and _event .conn .type not in hook .clients :
323
323
return True
324
324
325
- coro = self .plugin_manager .launch (hook , _event )
326
- tasks .append (coro )
325
+ tasks .append ((hook , _event ))
327
326
328
327
if hook .action is Action .HALTALL :
329
328
halted = True
@@ -417,5 +416,10 @@ def add_hook(hook, _event):
417
416
# The hook has an action of Action.HALT* so stop adding new tasks
418
417
break
419
418
419
+ tasks .sort (key = lambda t : t [0 ].priority )
420
+
420
421
# Run the tasks
421
- await asyncio .gather (* tasks , loop = self .loop )
422
+ await asyncio .gather (* [
423
+ asyncio .ensure_future (self .plugin_manager .launch (hook , _event ))
424
+ for hook , _event in tasks
425
+ ], loop = self .loop )
You can’t perform that action at this time.
0 commit comments