mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
classify不阻塞请求
This commit is contained in:
parent
48632e25b8
commit
3fc165d636
@ -14,7 +14,6 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
BLOCK_REQUEST_CLASS = false
|
||||
CACHE_IMG_FILE = "/tmp/setugt"
|
||||
CACHE_URI = "file:///" + CACHE_IMG_FILE
|
||||
VOTE_API_URL = "http://saki.fumiama.top/vote?uuid=零号&img=%s&class=%d"
|
||||
@ -24,10 +23,7 @@ var (
|
||||
)
|
||||
|
||||
func Classify(ctx *zero.Ctx, targeturl string, noimg bool) {
|
||||
if BLOCK_REQUEST_CLASS {
|
||||
ctx.Send("请稍后再试哦")
|
||||
} else {
|
||||
BLOCK_REQUEST_CLASS = true
|
||||
|
||||
get_url := CLASSIFY_HEAD + url.QueryEscape(targeturl)
|
||||
if noimg {
|
||||
get_url += "&noimg=true"
|
||||
@ -60,8 +56,6 @@ func Classify(ctx *zero.Ctx, targeturl string, noimg bool) {
|
||||
replyClass(ctx, dhash, class, noimg)
|
||||
}
|
||||
}
|
||||
BLOCK_REQUEST_CLASS = false
|
||||
}
|
||||
}
|
||||
|
||||
func Vote(ctx *zero.Ctx, class int) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user