diff --git a/src/backend/bisheng/api/services/role_group_service.py b/src/backend/bisheng/api/services/role_group_service.py index 6e8ef57fd..66c349edf 100644 --- a/src/backend/bisheng/api/services/role_group_service.py +++ b/src/backend/bisheng/api/services/role_group_service.py @@ -132,6 +132,7 @@ def delete_group_hook(self, request: Request, login_user: UserPayload, group_inf # 将删除事件发到redis队列中 delete_message = json.dumps({"id": group_info.id}) redis_client.rpush('delete_group', delete_message) + redis_client.expire_key('delete_group', 86400) redis_client.publish('delete_group', delete_message) def get_group_user_list(self, group_id: int, page_size: int, page_num: int) -> List[User]: diff --git a/src/backend/bisheng/database/models/group_resource.py b/src/backend/bisheng/database/models/group_resource.py index 314378eff..d0f179432 100644 --- a/src/backend/bisheng/database/models/group_resource.py +++ b/src/backend/bisheng/database/models/group_resource.py @@ -112,7 +112,7 @@ def get_group_all_resource(cls, group_id: int) -> List[GroupResource]: """ with session_getter() as session: return session.exec( - select(GroupResource).where(GroupResource.group_id == group_id)) + select(GroupResource).where(GroupResource.group_id == group_id)).all() @classmethod def update_group_resource(cls, group_resources: List[GroupResource]) -> List[GroupResource]: