mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
✏️ 同步时序
This commit is contained in:
parent
8969c44b3f
commit
0712a80ea0
@ -7,6 +7,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"sync"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
reg "github.com/fumiama/go-registry"
|
reg "github.com/fumiama/go-registry"
|
||||||
@ -19,6 +20,7 @@ const (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
registry = reg.NewRegReader("reilia.eastasia.azurecontainer.io:32664", "fumiama")
|
registry = reg.NewRegReader("reilia.eastasia.azurecontainer.io:32664", "fumiama")
|
||||||
|
lzmu sync.Mutex
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetLazyData(path string, isReturnDataBytes, isDataMustEqual bool) ([]byte, error) {
|
func GetLazyData(path string, isReturnDataBytes, isDataMustEqual bool) ([]byte, error) {
|
||||||
@ -29,6 +31,7 @@ func GetLazyData(path string, isReturnDataBytes, isDataMustEqual bool) ([]byte,
|
|||||||
|
|
||||||
logrus.Infoln("[file]检查懒加载文件:", path)
|
logrus.Infoln("[file]检查懒加载文件:", path)
|
||||||
u := dataurl + path
|
u := dataurl + path
|
||||||
|
lzmu.Lock()
|
||||||
err := registry.Connect()
|
err := registry.Connect()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Errorln("[file]无法连接到md5验证服务器,请自行确保下载文件的正确性:", err)
|
logrus.Errorln("[file]无法连接到md5验证服务器,请自行确保下载文件的正确性:", err)
|
||||||
@ -42,6 +45,7 @@ func GetLazyData(path string, isReturnDataBytes, isDataMustEqual bool) ([]byte,
|
|||||||
_ = registry.Close()
|
_ = registry.Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
lzmu.Unlock()
|
||||||
|
|
||||||
if IsExist(path) {
|
if IsExist(path) {
|
||||||
data, err = os.ReadFile(path)
|
data, err = os.ReadFile(path)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user