From e50d4bdf34c8a56ee95d1d6bec843bb24535e7b5 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Thu, 27 Apr 2023 18:10:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93=E8=AF=AD=E8=A8=80=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E9=9A=8F=E7=9D=80=E9=A1=B9=E7=9B=AE=E6=95=B0=E5=8F=98?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E8=AE=A1=E7=AE=97=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations/organizations_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/organizations/organizations_controller.rb b/app/controllers/organizations/organizations_controller.rb index 31300f1ea..3c4e64780 100644 --- a/app/controllers/organizations/organizations_controller.rb +++ b/app/controllers/organizations/organizations_controller.rb @@ -88,7 +88,7 @@ class Organizations::OrganizationsController < Organizations::BaseController projects = @organization.projects projects_count = @organization.projects.count - languages_hash = Rails.cache.fetch("query/organizations/languages/#{@organization.id}/#{projects_count}", :expires_in => 1.days) do + languages_hash = Rails.cache.fetch("query/organizations/languages/#{@organization.id}/#{projects_count}/2023", :expires_in => 1.days) do total_languages(projects) end @@ -97,7 +97,7 @@ class Organizations::OrganizationsController < Organizations::BaseController total_byte_size = sort_hash.values.sum # Rails.logger.info "languages_hash=============#{sort_hash}" sort_hash= sort_hash.transform_values { |v| - ActionController::Base.helpers.number_to_percentage((v / total_byte_size), precision: 1) + ActionController::Base.helpers.number_to_percentage((v * 100 / total_byte_size), precision: 1) }.select { |k, v| v != "0.0%" } render json: sort_hash end