✏️ 优化 updater log

This commit is contained in:
fumiama 2021-12-14 13:17:46 +08:00
parent fcf62a31e1
commit 4485d3d5a9
2 changed files with 7 additions and 6 deletions

View File

@ -17,6 +17,7 @@ import (
"github.com/FloatTech/ZeroBot-Plugin/control"
fileutil "github.com/FloatTech/ZeroBot-Plugin/utils/file"
"github.com/FloatTech/ZeroBot-Plugin/utils/math"
"github.com/FloatTech/ZeroBot-Plugin/utils/process"
"github.com/FloatTech/ZeroBot-Plugin/utils/rule"
"github.com/FloatTech/ZeroBot-Plugin/utils/sql"
)
@ -33,10 +34,6 @@ type imgpool struct {
Form int64
}
const (
dburl = "https://codechina.csdn.net/u011570312/ZeroBot-Plugin/-/raw/master/data/SetuTime/SetuTime.db"
)
// NewPoolsCache 返回一个缓冲池对象
func newPools() *imgpool {
cache := &imgpool{
@ -65,11 +62,15 @@ func newPools() *imgpool {
}
var (
pool = newPools()
pool *imgpool
limit = rate.NewManager(time.Minute*1, 5)
)
func init() { // 插件主体
go func() {
process.SleepAbout1sTo2s()
pool = newPools()
}()
engine := control.Register("setutime", &control.Options{
DisableOnDefault: false,
Help: "涩图\n" +

View File

@ -30,9 +30,9 @@ func GetLazyData(path string, isReturnDataBytes, isDataMustEqual bool) ([]byte,
var filemd5 *[16]byte
var ms string
logrus.Infoln("[file]检查懒加载文件:", path)
u := dataurl + path
lzmu.Lock()
logrus.Infoln("[file]检查懒加载文件:", path)
err := registry.ConnectIn(time.Second * 4)
if err != nil {
logrus.Errorln("[file]无法连接到md5验证服务器请自行确保下载文件的正确性:", err)