Skip to content

Commit 6f4440d

Browse files
committed
timeout change to 2hour
1 parent c373fcf commit 6f4440d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

backend/modules/evaluation/domain/entity/expt_insight_analysis_record.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const (
1515
)
1616

1717
const (
18-
ThreeHour = 3 * time.Hour
18+
InsightAnalysisRunningTimeout = 2 * time.Hour
1919
)
2020

2121
type ExptInsightAnalysisRecord struct {

backend/modules/evaluation/domain/service/insight_analysis_impl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func (e ExptInsightAnalysisServiceImpl) checkAnalysisReportGenStatus(ctx context
160160
}
161161

162162
// 超过3小时,未生成分析报告,认为是失败
163-
if status == entity.ReportStatus_Running && record.CreatedAt.Add(entity.ThreeHour).Unix() <= time.Now().Unix() {
163+
if status == entity.ReportStatus_Running && record.CreatedAt.Add(entity.InsightAnalysisRunningTimeout).Unix() <= time.Now().Unix() {
164164
record.Status = entity.InsightAnalysisStatus_Failed
165165
logs.CtxWarn(ctx, "checkAnalysisReportGenStatus found timeout event, expt_id: %v, record_id: %v", record.ExptID, record.ID)
166166
return e.repo.UpdateAnalysisRecord(ctx, record)
@@ -207,7 +207,7 @@ func (e ExptInsightAnalysisServiceImpl) GetAnalysisRecordByID(ctx context.Contex
207207
return nil, err
208208
}
209209

210-
if analysisRecord.Status == entity.InsightAnalysisStatus_Running && analysisRecord.CreatedAt.Add(entity.ThreeHour).Unix() < time.Now().Unix() {
210+
if analysisRecord.Status == entity.InsightAnalysisStatus_Running && analysisRecord.CreatedAt.Add(entity.InsightAnalysisRunningTimeout).Unix() < time.Now().Unix() {
211211
analysisRecord.Status = entity.InsightAnalysisStatus_Failed
212212
err = e.repo.UpdateAnalysisRecord(ctx, analysisRecord)
213213
if err != nil {

0 commit comments

Comments
 (0)