aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2024-07-06 09:50:39 +0800
committer简律纯 <i@jyunko.cn>2024-07-06 09:50:39 +0800
commit7e655c96fa5fab04bde014b62c8db3f4b352a5dc (patch)
tree37fc8615d32dbb230ef34f2ac74039a3351a24ef
parente44fe8dfba3a56da39f444cfeb62acd0945a9462 (diff)
downloadHydroRollCore-7e655c96fa5fab04bde014b62c8db3f4b352a5dc.tar.gz
HydroRollCore-7e655c96fa5fab04bde014b62c8db3f4b352a5dc.zip
refactor(core): fix AttributeError: wrong 'rule_disable_hook_func' method
-rw-r--r--Cargo.toml2
-rw-r--r--examples/rules/BRP/__init__.py6
-rw-r--r--hrc/core.py4
3 files changed, 9 insertions, 3 deletions
diff --git a/Cargo.toml b/Cargo.toml
index a527a66..d9a9a5f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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"
diff --git a/examples/rules/BRP/__init__.py b/examples/rules/BRP/__init__.py
new file mode 100644
index 0000000..54f2261
--- /dev/null
+++ b/examples/rules/BRP/__init__.py
@@ -0,0 +1,6 @@
+from hrc.rule import Rule
+
+class BRP(Rule):
+ async def handle(self) -> None: ...
+
+ async def rule(self) -> bool: return False \ No newline at end of file
diff --git a/hrc/core.py b/hrc/core.py
index cb8da6e..0e124e3 100644
--- a/hrc/core.py
+++ b/hrc/core.py
@@ -180,8 +180,8 @@ class Core:
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: