Skip to content

Commit

Permalink
更新错误显示,以便追踪到协程内的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
derekwin committed Feb 21, 2023
1 parent ab07810 commit 54ff4ed
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
6 changes: 2 additions & 4 deletions biz/handler/core/feed_server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions biz/handler/core/publish_action_server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions biz/handler/core/register_server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions biz/handler/core/user_info_server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions kitex_server/userservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ func GetUserLatestMap(idSet []int64, currentUser int64, respUserMap chan map[int

// 更新数据
for id, user := range AuthorMap {
favoriteCountMap := FavoriteCountMap[id]
var totalFavourited int64
var favoriteCount int64
if len(favoriteCountMap) == 2 { // 服务失效时,会越界
totalFavourited = favoriteCountMap[0]
favoriteCount = favoriteCountMap[1]
}
AuthorMap[id] = core.User{
ID: user.ID,
Name: user.Name,
Expand All @@ -151,9 +158,9 @@ func GetUserLatestMap(idSet []int64, currentUser int64, respUserMap chan map[int
Avatar: user.Avatar,
BackgroundImage: user.BackgroundImage,
Signature: user.Signature,
TotalFavourited: strconv.FormatInt(FavoriteCountMap[id][1], 10), // TODO: 从获取的数据中拿
WorkCount: VideoCountMap[id].Count, // 最新的count数据
FavoriteCount: FavoriteCountMap[id][0], // TODO: 从获取的数据中拿
TotalFavourited: strconv.FormatInt(totalFavourited, 10), // TODO: 从获取的数据中拿
WorkCount: VideoCountMap[id].Count, // 最新的count数据
FavoriteCount: favoriteCount, // TODO: 从获取的数据中拿
}

}
Expand Down Expand Up @@ -191,10 +198,12 @@ func RegisterUserALL(username, password string, email, signature, backgroundImag
BackgroundImage: backgroundImage,
Avatar: avatar,
}
println(211)
r, err := Userclient.CreateUserMethod(context.Background(), &usermicro.CreateUserReq{
Newuser_: &newUser,
Password: password, // 此处传输明文,加密由user微服务进行
})
println(222)
if err != nil {
return 0, err
}
Expand Down

0 comments on commit 54ff4ed

Please sign in to comment.