Skip to content

Commit

Permalink
Merge pull request #154 from isucon/fix/final-state
Browse files Browse the repository at this point in the history
本選かどうかの状態の条件分岐が取れていない箇所があった
  • Loading branch information
sapphi-red authored Aug 17, 2021
2 parents 669e6a4 + 3509720 commit 795dbaf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion portal/app/controllers/api/admin/dashboards_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class Api::Admin::DashboardsController < Api::Admin::ApplicationController
pb :show, Isuxportal::Proto::Services::Admin::DashboardQuery
def show
final = Rails.application.config.x.final ? "final" : "qualify"
final = Rails.application.config.x.contest.final ? "final" : "qualify"
clar_count = Clarification.unanswered.requested.count
cached_lb = Rails.cache.read("leaderboard:#{final}:admin")&.yield_self { |_| Isuxportal::Proto::Resources::Leaderboard.decode(_) }
render protobuf: Isuxportal::Proto::Services::Admin::DashboardResponse.new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Api::Audience::DashboardsController < Api::Audience::ApplicationController
pb :show, Isuxportal::Proto::Services::Audience::DashboardQuery
def show
expires_in 5.seconds, public: true, 's-maxage' => '10'
final = Rails.application.config.x.final ? "final" : "qualify"
final = Rails.application.config.x.contest.final ? "final" : "qualify"
render protobuf: Rails.cache.read("dashboard:#{final}:audience:public") || Isuxportal::Proto::Services::Audience::DashboardResponse.new(
leaderboard: Contest.leaderboard(admin: false, team: nil), # TODO: disable progresses
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Api::Contestant::DashboardsController < Api::Contestant::ApplicationContro
pb :show, Isuxportal::Proto::Services::Contestant::DashboardQuery
def show
# See also: UpdateContestantDashboardJob
final = Rails.application.config.x.final ? "final" : "qualify"
final = Rails.application.config.x.contest.final ? "final" : "qualify"
ptr = Rails.cache.read("dashboard:#{final}:contestant:contestant-ptr:team-#{current_team.id}") || "dashboard:#{final}:contestant:public"
if ptr && ptr.start_with?("dashboard:#{final}:contestant:")
ptr_resp = Rails.cache.read(ptr)
Expand Down
2 changes: 1 addition & 1 deletion portal/app/jobs/update_contestant_dashboard_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class UpdateContestantDashboardJob < ApplicationJob
def perform(team: nil, frozen: false)
final = Rails.application.config.x.final ? "final" : "qualify"
final = Rails.application.config.x.contest.final ? "final" : "qualify"

Rails.logger.info("leaderboard")
lb = Contest.leaderboard(admin: false, team: nil, progresses: false)
Expand Down

0 comments on commit 795dbaf

Please sign in to comment.