diff --git a/bench/scenario/core_finalcheck.go b/bench/scenario/core_finalcheck.go index 1cf236850..7313f8846 100644 --- a/bench/scenario/core_finalcheck.go +++ b/bench/scenario/core_finalcheck.go @@ -2,7 +2,9 @@ package scenario import ( "context" + "encoding/json" "os" + "time" "github.com/isucon/isucandar/agent" "github.com/isucon/isucon13/bench/internal/config" @@ -13,6 +15,17 @@ import ( func FinalcheckScenario(ctx context.Context, contestantLogger *zap.Logger, dnsResolver *resolver.DNSResolver) error { + // 3秒待つ +loop: + for { + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(3 * time.Second): + break loop + } + } + client, err := isupipe.NewCustomResolverClient( contestantLogger, dnsResolver, @@ -21,9 +34,17 @@ func FinalcheckScenario(ctx context.Context, contestantLogger *zap.Logger, dnsRe if err != nil { return err } - - // FIXME: ライブコメント存在チェック - _ = client + // タグ指定なし検索 + searchedStream, err := client.SearchLivestreams(ctx, isupipe.WithLimitQueryParam(config.NumSearchLivestreams)) + if err != nil { + return err + } + lgr := zap.S() + b, err := json.Marshal(searchedStream) + if err != nil { + return err + } + lgr.Info("Finalcheck SearchLivestreams", string(b)) if err := os.WriteFile(config.FinalcheckPath, []byte("{}"), os.ModePerm); err != nil { return err