Skip to content

Commit

Permalink
refactor(core): fix AttributeError: wrong 'rule_disable_hook_func' me…
Browse files Browse the repository at this point in the history
…thod
  • Loading branch information
HsiangNianian committed Jul 6, 2024
1 parent e44fe8d commit 7e655c9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hydro-roll-core"
version = "0.0.2-alpha.2"
version = "0.0.2"
edition = "2021"
description = "Core Lib for HydroRoll System."
license = "MIT"
Expand Down
6 changes: 6 additions & 0 deletions examples/rules/BRP/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from hrc.rule import Rule

class BRP(Rule):
async def handle(self) -> None: ...

async def rule(self) -> bool: return False
4 changes: 2 additions & 2 deletions hrc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ async def _run(self) -> None:
await hot_reload_task
finally:
for _rule in self.rules:
for rule_shutdown_hook_func in self._rule_shutdown_hooks:
await rule_shutdown_hook_func(_rule)
for rule_disable_hook_func in self._rule_disable_hooks:
await rule_disable_hook_func(_rule)
await _rule.disable()

while self._rule_tasks:
Expand Down

0 comments on commit 7e655c9

Please sign in to comment.