diff options
Diffstat (limited to 'app/helpers/projects_helper.rb')
-rw-r--r-- | app/helpers/projects_helper.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index bda9a69d71f..64df416bd43 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -384,9 +384,12 @@ module ProjectsHelper end def project_license_name(project) - project.repository.license&.name + key = "project:#{project.id}:license_name" + + Gitlab::SafeRequestStore.fetch(key) { project.repository.license&.name } rescue GRPC::Unavailable, GRPC::DeadlineExceeded, Gitlab::Git::CommandError => e Gitlab::ErrorTracking.track_exception(e) + Gitlab::SafeRequestStore[key] = nil nil end |