Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:增加煎蛋网无聊图 #115

Merged
merged 9 commits into from
Feb 8, 2022
Merged

feat:增加煎蛋网无聊图 #115

merged 9 commits into from
Feb 8, 2022

Conversation

guohuiyuan
Copy link
Contributor

No description provided.

order/prio.go Outdated
@@ -24,6 +24,7 @@ const (
PrioDiana
PrioFansDaily
PrioFortune
PrioJandan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

位置要符合英文字母顺序


func init() {
go func() {
defer order.DoneOnExit()()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不调用 GetLazyData 的 init 无需使用 DoneOnExit

}

func travelWebpage() {
err := db.Del("picture", "where 1 = 1")
Copy link
Member

@fumiama fumiama Feb 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议使用 db.Truncate,但是每次更新全删掉的话,不如不用数据库

func travelWebpage() {
err := db.Del("picture", "where 1 = 1")
log.Errorln("[jandan]:", err)
chanPicture = make(chan string, 100000)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

太大了,而且不需要每次运行都新建

if err != nil {
log.Errorln("[jandan]:", err)
}
go scorePicture()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数也不用每次运行都调用,不然不如不用 chan

// 加载数据库
func init() {
go func() {
defer order.DoneOnExit()()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同理

@fumiama fumiama merged commit 45edd86 into FloatTech:master Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants