Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE][bench] 完成したグラフを再度見ていたバグの修正 #1434

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions bench/scenario/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,6 @@ func (s *Scenario) requestGraphScenario(ctx context.Context, step *isucandar.Ben
nowVirtualTime := s.ToVirtualTime(time.Now())
// 割り算で切り捨てを発生させている(day単位にしている)
virtualToday := trancateTimestampToDate(nowVirtualTime)
virtualToday -= OneDay

graphResponses, errs := getIsuGraphUntilLastViewed(ctx, user, targetIsu, virtualToday)
if len(errs) > 0 {
Expand Down Expand Up @@ -792,7 +791,7 @@ func getNewLastCompletedGraphTime(graphResponses []*service.GraphResponse, virtu
for hour, g := range *gr {
// 12時以降のデータがあるならその前日のグラフは完成している
if hour >= 12 && g.Data != nil {
completedDay := virtualToday - (OneDay * int64(behindDay))
completedDay := virtualToday - (OneDay * int64(behindDay+1))
if lastCompletedGraphTime < completedDay {
lastCompletedGraphTime = completedDay
}
Expand Down Expand Up @@ -869,7 +868,7 @@ func getIsuGraphUntilLastViewed(
// 一日前
virtualDay -= 24 * 60 * 60
// すでに見たグラフなら終わる
if virtualDay == targetIsu.LastCompletedGraphTime {
if virtualDay <= targetIsu.LastCompletedGraphTime {
return graph, nil
}

Expand Down