feat: 分组管理内存集群同步缓存

This commit is contained in:
tbphp
2025-07-09 23:09:25 +08:00
parent ae4644f287
commit 01fff0d70c
5 changed files with 107 additions and 0 deletions

View File

@@ -210,6 +210,9 @@ func (s *Server) CreateGroup(c *gin.Context) {
return
}
if err := s.GroupManager.Invalidate(); err != nil {
logrus.WithContext(c.Request.Context()).WithError(err).Error("failed to invalidate group cache")
}
response.Success(c, s.newGroupResponse(&group))
}
@@ -341,6 +344,9 @@ func (s *Server) UpdateGroup(c *gin.Context) {
return
}
if err := s.GroupManager.Invalidate(); err != nil {
logrus.WithContext(c.Request.Context()).WithError(err).Error("failed to invalidate group cache")
}
response.Success(c, s.newGroupResponse(&group))
}
@@ -471,6 +477,9 @@ func (s *Server) DeleteGroup(c *gin.Context) {
return
}
if err := s.GroupManager.Invalidate(); err != nil {
logrus.WithContext(c.Request.Context()).WithError(err).Error("failed to invalidate group cache")
}
response.Success(c, gin.H{"message": "Group and associated keys deleted successfully"})
}