Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba0f9bfd98 | ||
|
|
d07881bc29 | ||
| cdcdac3531 | |||
| 0a19bb5518 | |||
| c7409fbf02 | |||
|
|
82d3824cae |
@@ -42,6 +42,9 @@ var (
|
||||
getFileName, err := g.Cfg("hack").Get(ctx, "gfcli.build.name")
|
||||
Filename := getFileName.String()
|
||||
|
||||
getPath, err := g.Cfg("hack").Get(ctx, "gfcli.build.path")
|
||||
Path := getPath.String()
|
||||
|
||||
//获取版本号
|
||||
getVersion, err := g.Cfg("hack").Get(ctx, "gfcli.build.version")
|
||||
Version := getVersion.String()
|
||||
@@ -89,7 +92,7 @@ var (
|
||||
if v.Arch != "" && v.System != "" {
|
||||
systemName = v.System + "_" + v.Arch
|
||||
}
|
||||
var filename = path.Join(Version, systemName, Filename)
|
||||
var filename = path.Join(Path, Version, systemName, Filename)
|
||||
g.Log().Debugf(ctx, "当前上传文件:"+filename)
|
||||
|
||||
url[v.S3], err = UploadS3(v.S3, filename)
|
||||
@@ -109,9 +112,24 @@ var (
|
||||
FileUrl: url[v.S3],
|
||||
})
|
||||
if err != nil {
|
||||
Proxy := g.Cfg().MustGet(ctx, "update_proxy", "http://192.168.50.170:10808").String()
|
||||
g.Log().Debugf(ctx, "切换代理进行上传:err=%v", err)
|
||||
get, err = client.Proxy(Proxy).Post(ctx, address+"/callback/update", &UpdateReq{
|
||||
// 读取HTTP代理环境变量(小写/大写通常都兼容,部分系统可能用大写)
|
||||
httpProxy := os.Getenv("http_proxy")
|
||||
if httpProxy == "" {
|
||||
httpProxy = os.Getenv("HTTP_PROXY")
|
||||
}
|
||||
if httpProxy == "" {
|
||||
// 读取HTTPS代理环境变量
|
||||
httpProxy = os.Getenv("https_proxy")
|
||||
if httpProxy == "" {
|
||||
httpProxy = os.Getenv("HTTPS_PROXY")
|
||||
}
|
||||
}
|
||||
// 如果没有读取到本地的代理,使用配置上传
|
||||
if httpProxy == "" {
|
||||
httpProxy = g.Cfg().MustGet(ctx, "update_proxy", "http://192.168.50.173:10808").String()
|
||||
}
|
||||
g.Log().Debugf(ctx, "切换代理进行上传:ip=%v,err=%v", httpProxy, err)
|
||||
get, err = client.Proxy(httpProxy).Post(ctx, address+"/callback/update", &UpdateReq{
|
||||
FileUrl: url[v.S3],
|
||||
})
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ func TestGamelog(t *testing.T) {
|
||||
// 可填
|
||||
RetryN: 2, // 默认每10次, 上传检查一次磁盘的失败数据
|
||||
ChanSize: 500, // 默认1000, 信道size
|
||||
SendSaveType: 1, // 发送存储类型, 默认不设置为0代表文件存储, 1代表走kafka可实同步日志
|
||||
SendSaveType: 2, // 发送存储类型, 默认不设置为0代表文件存储, 2代表走kafka可实同步日志
|
||||
})
|
||||
|
||||
// 随机测试事件和属性
|
||||
|
||||
@@ -152,3 +152,8 @@ func (m *timeMod) CheckIsBeRwd(createdTime, lastRwdTime time.Time, _now ...time.
|
||||
// 如果是,则说明还没领过,可以领取
|
||||
return lastRwdTime.Before(refreshToday)
|
||||
}
|
||||
|
||||
// 获取指定时间的本月最后一刻
|
||||
func (m *timeMod) EndOfMonth(t time.Time) time.Time {
|
||||
return time.Date(t.Year(), t.Month()+1, 1, 0, 0, 0, 0, t.Location()).Add(-time.Second)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user