fix: 图片缓存池

This commit is contained in:
fumiama
2022-02-26 23:20:08 +08:00
parent 88318a7151
commit cf52997279
5 changed files with 23 additions and 33 deletions

View File

@@ -49,16 +49,12 @@ func init() { // 插件主体
if file.IsNotExist(f) {
m, err = pool.GetImage(n)
if err == nil {
err = file.DownloadTo(m.String(), f, true)
if err != nil {
ctx.SendChain(message.Text("ERROR: ", err))
return
}
break
imgs = append(imgs, message.Image(m.String()))
continue
}
logrus.Debugln("[sausenao]开始下载", n)
err = illust.DownloadToCache(i)
if err == nil {
err1 := illust.DownloadToCache(i)
if err != pool.ErrImgFileAsync && err1 == nil {
m.SetFile(f)
_, _ = m.Push(ctxext.SendToSelf(ctx), ctxext.GetMessage(ctx))
}