Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tukeJonny committed Nov 2, 2023
1 parent 89eb04b commit cdaa61b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
1 change: 1 addition & 0 deletions bench/internal/scheduler/reservation.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func mustNewReservation(id int, title string, description string, startAtStr str
}

reservation := &Reservation{
id: id,
Title: title,
Description: description,
StartAt: startAt.Unix(),
Expand Down
3 changes: 0 additions & 3 deletions bench/scenario/streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/isucon/isucon13/bench/internal/scheduler"
"github.com/isucon/isucon13/bench/isupipe"
"go.uber.org/zap"
)

func BasicPopularStreamerScenario(
Expand All @@ -22,11 +21,9 @@ func BasicStreamerColdReserveScenario(
popularLivestreamPool *isupipe.LivestreamPool,
livestreamPool *isupipe.LivestreamPool,
) error {
lgr := zap.S()

client, err := streamerPool.Get(ctx)
if err != nil {
lgr.Info("failed to get client from streamer pool")
return err
}
defer streamerPool.Put(ctx, client) // 使い終わったらお片付け
Expand Down
8 changes: 0 additions & 8 deletions bench/scenario/viewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,35 @@ import (
"github.com/isucon/isucon13/bench/internal/config"
"github.com/isucon/isucon13/bench/internal/scheduler"
"github.com/isucon/isucon13/bench/isupipe"
"go.uber.org/zap"
)

func BasicViewerScenario(
ctx context.Context,
viewerPool *isupipe.ClientPool,
livestreamPool *isupipe.LivestreamPool,
) error {
lgr := zap.S()

client, err := viewerPool.Get(ctx)
if err != nil {
lgr.Info("failed to get client from viewer pool", zap.Error(err))
return err
}
defer viewerPool.Put(ctx, client)

if err := VisitTop(ctx, client); err != nil {
lgr.Info("failed to visit top", zap.Error(err))
return err
}

livestream, err := livestreamPool.Get(ctx)
if err != nil {
lgr.Info("failed to get livestream from pool(as viewer)", zap.Error(err))
return err
}
defer livestreamPool.Put(ctx, livestream)

if err := VisitLivestream(ctx, client, livestream); err != nil {
lgr.Info("failed to visit livestream", zap.Error(err))
return err
}

if err := client.EnterLivestream(ctx, livestream.ID); err != nil {
lgr.Info("failed to enter livestream", zap.Error(err))
return err
}

Expand All @@ -64,7 +57,6 @@ func BasicViewerScenario(
}

if err := client.LeaveLivestream(ctx, livestream.ID); err != nil {
lgr.Info("failed to enter livestream", zap.Error(err))
return err
}

Expand Down

0 comments on commit cdaa61b

Please sign in to comment.