Skip to content

Commit

Permalink
使用全局函数
Browse files Browse the repository at this point in the history
  • Loading branch information
PaienNate committed Oct 28, 2024
1 parent f578859 commit b07b413
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions dice/im_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1454,10 +1454,8 @@ func (s *IMSession) LongTimeQuitInactiveGroupReborn(threshold time.Time, groupsP
ep.Adapter.QuitGroup(msgCtx, grp.GroupID)
// 发出提示
msgCtx.Notice(hint)
// 等待十秒
r := rand.New(rand.NewSource(time.Now().UnixNano()))
// 生成一个随机值(8~11秒随机)
randomSleep := time.Duration(r.Intn(3000)+8000) * time.Millisecond
randomSleep := time.Duration(rand.Intn(3000)+8000) * time.Millisecond
log.Infof("退群等待,等待 %f 秒后继续", randomSleep.Seconds())
time.Sleep(randomSleep)
}
Expand Down

0 comments on commit b07b413

Please sign in to comment.