mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-21 15:30:09 +08:00
✏️ 优化 updater log
This commit is contained in:
parent
fcf62a31e1
commit
4485d3d5a9
@ -17,6 +17,7 @@ import (
|
|||||||
"github.com/FloatTech/ZeroBot-Plugin/control"
|
"github.com/FloatTech/ZeroBot-Plugin/control"
|
||||||
fileutil "github.com/FloatTech/ZeroBot-Plugin/utils/file"
|
fileutil "github.com/FloatTech/ZeroBot-Plugin/utils/file"
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/utils/math"
|
"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/rule"
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/utils/sql"
|
"github.com/FloatTech/ZeroBot-Plugin/utils/sql"
|
||||||
)
|
)
|
||||||
@ -33,10 +34,6 @@ type imgpool struct {
|
|||||||
Form int64
|
Form int64
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
|
||||||
dburl = "https://codechina.csdn.net/u011570312/ZeroBot-Plugin/-/raw/master/data/SetuTime/SetuTime.db"
|
|
||||||
)
|
|
||||||
|
|
||||||
// NewPoolsCache 返回一个缓冲池对象
|
// NewPoolsCache 返回一个缓冲池对象
|
||||||
func newPools() *imgpool {
|
func newPools() *imgpool {
|
||||||
cache := &imgpool{
|
cache := &imgpool{
|
||||||
@ -65,11 +62,15 @@ func newPools() *imgpool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
pool = newPools()
|
pool *imgpool
|
||||||
limit = rate.NewManager(time.Minute*1, 5)
|
limit = rate.NewManager(time.Minute*1, 5)
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() { // 插件主体
|
func init() { // 插件主体
|
||||||
|
go func() {
|
||||||
|
process.SleepAbout1sTo2s()
|
||||||
|
pool = newPools()
|
||||||
|
}()
|
||||||
engine := control.Register("setutime", &control.Options{
|
engine := control.Register("setutime", &control.Options{
|
||||||
DisableOnDefault: false,
|
DisableOnDefault: false,
|
||||||
Help: "涩图\n" +
|
Help: "涩图\n" +
|
||||||
|
|||||||
@ -30,9 +30,9 @@ func GetLazyData(path string, isReturnDataBytes, isDataMustEqual bool) ([]byte,
|
|||||||
var filemd5 *[16]byte
|
var filemd5 *[16]byte
|
||||||
var ms string
|
var ms string
|
||||||
|
|
||||||
logrus.Infoln("[file]检查懒加载文件:", path)
|
|
||||||
u := dataurl + path
|
u := dataurl + path
|
||||||
lzmu.Lock()
|
lzmu.Lock()
|
||||||
|
logrus.Infoln("[file]检查懒加载文件:", path)
|
||||||
err := registry.ConnectIn(time.Second * 4)
|
err := registry.ConnectIn(time.Second * 4)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Errorln("[file]无法连接到md5验证服务器,请自行确保下载文件的正确性:", err)
|
logrus.Errorln("[file]无法连接到md5验证服务器,请自行确保下载文件的正确性:", err)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user