修复IPBox只能显示昨日日志的Bug

This commit is contained in:
GoEdgeLab
2022-04-22 09:15:08 +08:00
parent df4deb2efa
commit 4edca6b670

View File

@@ -103,6 +103,7 @@ func (this *IndexAction) RunGet(params struct {
// 访问日志 // 访问日志
var hasAccessLogs = false var hasAccessLogs = false
Loop:
for _, day := range []string{timeutil.Format("Ymd"), timeutil.Format("Ymd", time.Now().AddDate(0, 0, -1))} { for _, day := range []string{timeutil.Format("Ymd"), timeutil.Format("Ymd", time.Now().AddDate(0, 0, -1))} {
partitionsResp, err := this.RPC().HTTPAccessLogRPC().FindHTTPAccessLogPartitions(this.AdminContext(), &pb.FindHTTPAccessLogPartitionsRequest{Day: day}) partitionsResp, err := this.RPC().HTTPAccessLogRPC().FindHTTPAccessLogPartitions(this.AdminContext(), &pb.FindHTTPAccessLogPartitionsRequest{Day: day})
if err != nil { if err != nil {
@@ -125,7 +126,7 @@ func (this *IndexAction) RunGet(params struct {
if len(accessLogs) > 0 { if len(accessLogs) > 0 {
this.Data["accessLogs"] = accessLogs this.Data["accessLogs"] = accessLogs
hasAccessLogs = true hasAccessLogs = true
break break Loop
} }
} }
} }