mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
✏️ more log in updater
This commit is contained in:
parent
1cbc49251b
commit
b6dadc142b
@ -39,7 +39,7 @@ func GetLazyData(path string, isReturnDataBytes, isDataMustEqual bool) ([]byte,
|
||||
} else {
|
||||
ms, err = registry.Get(path)
|
||||
if err != nil || len(ms) != 16 {
|
||||
logrus.Errorln("[file]获取md5失败,请自行确保下载文件的正确性:", err)
|
||||
logrus.Errorln("[file]获取md5失败,请自行确保下载文件 %s 的正确性:", path, err)
|
||||
} else {
|
||||
filemd5 = (*[16]byte)(*(*unsafe.Pointer)(unsafe.Pointer(&ms)))
|
||||
logrus.Infoln("[file]从验证服务器获得文件md5:", hex.EncodeToString(filemd5[:]))
|
||||
@ -58,12 +58,12 @@ func GetLazyData(path string, isReturnDataBytes, isDataMustEqual bool) ([]byte,
|
||||
logrus.Infoln("[file]文件md5匹配,文件已存在且为最新")
|
||||
goto ret
|
||||
} else if !isDataMustEqual {
|
||||
logrus.Warnln("[file]文件md5不匹配,但不主动更新")
|
||||
logrus.Warnln("[file]文件", path, "md5不匹配,但不主动更新")
|
||||
goto ret
|
||||
}
|
||||
logrus.Infoln("[file]文件md5不匹配,开始更新文件")
|
||||
} else {
|
||||
logrus.Warnln("[file]文件存在,已跳过md5检查")
|
||||
logrus.Warnln("[file]文件", path, "存在,已跳过md5检查")
|
||||
goto ret
|
||||
}
|
||||
}
|
||||
@ -90,11 +90,11 @@ func GetLazyData(path string, isReturnDataBytes, isDataMustEqual bool) ([]byte,
|
||||
if md5.Sum(data) == *filemd5 {
|
||||
logrus.Infoln("[file]文件下载完成,md5匹配,开始保存")
|
||||
} else {
|
||||
logrus.Errorln("[file]文件md5不匹配,下载失败")
|
||||
logrus.Errorln("[file]文件", path, "md5不匹配,下载失败")
|
||||
return nil, errors.New("file md5 mismatch")
|
||||
}
|
||||
} else {
|
||||
logrus.Warnln("[file]文件下载完成,已跳过md5检查,开始保存")
|
||||
logrus.Warnln("[file]文件", path, "下载完成,已跳过md5检查,开始保存")
|
||||
}
|
||||
// 写入数据
|
||||
err = os.WriteFile(path, data, 0644)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user