Skip to content

Commit

Permalink
Merge pull request #2696 from actiontech/fix/get_username_err
Browse files Browse the repository at this point in the history
fix: 删除用户后,项目概览页面报错
  • Loading branch information
ColdWaterLW authored Oct 25, 2024
2 parents d71eac5 + c50a8a3 commit 08c4cd9
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions sqle/api/controller/v1/statistic.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package v1

import (
"context"
"math"
"net/http"
"time"
Expand Down Expand Up @@ -603,21 +602,12 @@ func StatisticRiskWorkflowV1(c echo.Context) error {

riskWorkflows := make([]*RiskWorkflow, len(projectWorkflowStatusDetails))
for i, info := range projectWorkflowStatusDetails {
user, err := func() (*model.User, error) {
ctx, cancel := context.WithTimeout(c.Request().Context(), 5*time.Second)
defer cancel()

return dms.GetUser(ctx, info.CreateUserId, controller.GetDMSServerAddress())
}()

if err != nil {
return controller.JSONBaseErrorReq(c, err)
}
userName := dms.GetUserNameWithDelTag(info.CreateUserId)
riskWorkflows[i] = &RiskWorkflow{
Name: info.Subject,
WorkflowID: info.WorkflowId,
Status: info.Status,
CreateUser: user.Name,
CreateUser: userName,
UpdateTime: info.UpdatedAt,
}
}
Expand Down

0 comments on commit 08c4cd9

Please sign in to comment.