关闭tg模式下大并发视频和文件
This commit is contained in:
parent
94b98b04de
commit
4a5328b654
|
@ -303,7 +303,7 @@ func Clip(in io.Reader, out io.Writer, wi, hi, x0, y0, x1, y1, quality int) (err
|
|||
return nil
|
||||
}
|
||||
|
||||
func WaitStudy(user *User) {
|
||||
func WaitStudy(user *User, id string) {
|
||||
i := 0
|
||||
for i <= 180 {
|
||||
score, err := GetUserScore(user.Cookies)
|
||||
|
@ -314,6 +314,7 @@ func WaitStudy(user *User) {
|
|||
score.Content["article"].CurrentScore >= score.Content["article"].MaxScore {
|
||||
return
|
||||
}
|
||||
|
||||
time.Sleep(10 * time.Second)
|
||||
i++
|
||||
}
|
||||
|
|
|
@ -313,9 +313,8 @@ func study(bot *Telegram, args []string) {
|
|||
defer datas.Delete(u)
|
||||
core.Init()
|
||||
defer core.Quit()
|
||||
go core.LearnArticle(cookies)
|
||||
go core.LearnVideo(cookies)
|
||||
WaitStudy(&User{Cookies: cookies})
|
||||
core.LearnArticle(cookies)
|
||||
core.LearnVideo(cookies)
|
||||
core.RespondDaily(cookies, "daily")
|
||||
core.RespondDaily(cookies, "weekly")
|
||||
core.RespondDaily(cookies, "special")
|
||||
|
|
Loading…
Reference in New Issue