mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
🐛 修复缓存图片重复
This commit is contained in:
parent
49e9240dfd
commit
3eee3d64f1
@ -50,14 +50,12 @@ func init() { // 插件主体
|
|||||||
ctx.Send("请稍后重试0x0...")
|
ctx.Send("请稍后重试0x0...")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var (
|
var type_ = ctx.State["regex_matched"].([]string)[1]
|
||||||
type_ = ctx.State["regex_matched"].([]string)[1]
|
|
||||||
illust = &utils.Illust{}
|
|
||||||
)
|
|
||||||
// TODO 补充池子
|
// TODO 补充池子
|
||||||
go func() {
|
go func() {
|
||||||
times := utils.Min(PoolsCache.Max-PoolsCache.Size(type_), 2)
|
times := utils.Min(PoolsCache.Max-PoolsCache.Size(type_), 2)
|
||||||
for i := 0; i < times; i++ {
|
for i := 0; i < times; i++ {
|
||||||
|
illust := &utils.Illust{}
|
||||||
// 查询出一张图片
|
// 查询出一张图片
|
||||||
if err := DB.Select(type_, illust, "ORDER BY RANDOM() limit 1"); err != nil {
|
if err := DB.Select(type_, illust, "ORDER BY RANDOM() limit 1"); err != nil {
|
||||||
ctx.Send(fmt.Sprintf("ERROR: %v", err))
|
ctx.Send(fmt.Sprintf("ERROR: %v", err))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user