mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-01-23 10:50:24 +08:00
commit
4804995c60
@ -49,5 +49,4 @@ func PublishClusterSync(ctx context.Context, channel string, message interface{}
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
g.Log().Warningf(ctx, "PublishClusterSync %v LockFunc err:%v", channel, err)
|
g.Log().Warningf(ctx, "PublishClusterSync %v LockFunc err:%v", channel, err)
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
@ -28,13 +28,13 @@ func (server *Server) startCron() {
|
|||||||
// 心跳超时检查
|
// 心跳超时检查
|
||||||
if gcron.Search(server.getCronKey(CronHeartbeatVerify)) == nil {
|
if gcron.Search(server.getCronKey(CronHeartbeatVerify)) == nil {
|
||||||
_, _ = gcron.AddSingleton(server.ctx, "@every 300s", func(ctx context.Context) {
|
_, _ = gcron.AddSingleton(server.ctx, "@every 300s", func(ctx context.Context) {
|
||||||
|
if server == nil || server.clients == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
server.mutexConns.Lock()
|
server.mutexConns.Lock()
|
||||||
defer server.mutexConns.Unlock()
|
defer server.mutexConns.Unlock()
|
||||||
|
|
||||||
if server == nil || server.clients == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for _, client := range server.clients {
|
for _, client := range server.clients {
|
||||||
if client.Heartbeat < gtime.Timestamp()-HeartbeatTimeout {
|
if client.Heartbeat < gtime.Timestamp()-HeartbeatTimeout {
|
||||||
client.Conn.Close()
|
client.Conn.Close()
|
||||||
@ -47,13 +47,13 @@ func (server *Server) startCron() {
|
|||||||
// 认证检查
|
// 认证检查
|
||||||
if gcron.Search(server.getCronKey(CronAuthVerify)) == nil {
|
if gcron.Search(server.getCronKey(CronAuthVerify)) == nil {
|
||||||
_, _ = gcron.AddSingleton(server.ctx, "@every 300s", func(ctx context.Context) {
|
_, _ = gcron.AddSingleton(server.ctx, "@every 300s", func(ctx context.Context) {
|
||||||
|
if server == nil || server.clients == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
server.mutexConns.Lock()
|
server.mutexConns.Lock()
|
||||||
defer server.mutexConns.Unlock()
|
defer server.mutexConns.Unlock()
|
||||||
|
|
||||||
if server == nil || server.clients == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for _, client := range server.clients {
|
for _, client := range server.clients {
|
||||||
if client.Auth == nil {
|
if client.Auth == nil {
|
||||||
continue
|
continue
|
||||||
|
@ -38,7 +38,7 @@ type Token struct {
|
|||||||
var (
|
var (
|
||||||
config *model.TokenConfig
|
config *model.TokenConfig
|
||||||
errorLogin = gerror.New("登录身份已失效,请重新登录!")
|
errorLogin = gerror.New("登录身份已失效,请重新登录!")
|
||||||
errorMultiLogin = gerror.New("账号存在异地登录,如非本人操作请及时修改登录密码!")
|
errorMultiLogin = gerror.New("账号已在其他地方登录,如非本人操作请及时修改登录密码!")
|
||||||
)
|
)
|
||||||
|
|
||||||
func SetConfig(c *model.TokenConfig) {
|
func SetConfig(c *model.TokenConfig) {
|
||||||
|
@ -431,7 +431,7 @@ func (s *sAdminMember) Delete(ctx context.Context, in *adminin.MemberDeleteInp)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err = dao.AdminMemberPost.Ctx(ctx).Where("member_id", memberId).Delete(); err != nil {
|
if _, err = dao.AdminMemberPost.Ctx(ctx).Where("member_id", in.Id).Delete(); err != nil {
|
||||||
err = gerror.Wrap(err, "删除用户岗位失败,请稍后重试!")
|
err = gerror.Wrap(err, "删除用户岗位失败,请稍后重试!")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user