关闭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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func WaitStudy(user *User) {
|
func WaitStudy(user *User, id string) {
|
||||||
i := 0
|
i := 0
|
||||||
for i <= 180 {
|
for i <= 180 {
|
||||||
score, err := GetUserScore(user.Cookies)
|
score, err := GetUserScore(user.Cookies)
|
||||||
|
@ -314,6 +314,7 @@ func WaitStudy(user *User) {
|
||||||
score.Content["article"].CurrentScore >= score.Content["article"].MaxScore {
|
score.Content["article"].CurrentScore >= score.Content["article"].MaxScore {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(10 * time.Second)
|
time.Sleep(10 * time.Second)
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,9 +313,8 @@ func study(bot *Telegram, args []string) {
|
||||||
defer datas.Delete(u)
|
defer datas.Delete(u)
|
||||||
core.Init()
|
core.Init()
|
||||||
defer core.Quit()
|
defer core.Quit()
|
||||||
go core.LearnArticle(cookies)
|
core.LearnArticle(cookies)
|
||||||
go core.LearnVideo(cookies)
|
core.LearnVideo(cookies)
|
||||||
WaitStudy(&User{Cookies: cookies})
|
|
||||||
core.RespondDaily(cookies, "daily")
|
core.RespondDaily(cookies, "daily")
|
||||||
core.RespondDaily(cookies, "weekly")
|
core.RespondDaily(cookies, "weekly")
|
||||||
core.RespondDaily(cookies, "special")
|
core.RespondDaily(cookies, "special")
|
||||||
|
|
Loading…
Reference in New Issue