refactor: remove enable_lock attribute and enhance locking mechanism in Model class

This commit is contained in:
HibiKier
2025-12-23 23:23:58 +08:00
parent af75d7fc5a
commit 587396eb49
4 changed files with 51 additions and 21 deletions
-2
View File
@@ -96,8 +96,6 @@ class GroupConsole(Model):
"""缓存类型"""
cache_key_field = ("group_id", "channel_id")
"""缓存键字段"""
enable_lock: ClassVar[list[DbLockType]] = [DbLockType.CREATE, DbLockType.UPSERT]
"""开启锁"""
lock_fields: ClassVar[dict[DbLockType, tuple[str, str]]] = {
DbLockType.CREATE: ("group_id", "channel_id"),
DbLockType.UPSERT: ("group_id", "channel_id"),