Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-11-20 15:40:45 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-11-20 15:40:45 +0300
commit5c131dac5e2e7fc85bcbef6c1c8e95912b7759d4 (patch)
treec689e17a42bccb305b24f7b3a8a88590edfd098a /lib
parent16346eb5b9b7aa1fa98a7eb7d9015f48856151ce (diff)
Fix bug where ID is not set
On HEAD~ we remove the ID from the class, which created a bug. Given we don't need the ID anymore, it has been removed and simplified.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/gitaly_client.rb9
-rw-r--r--lib/peek/views/gitaly.rb1
2 files changed, 4 insertions, 6 deletions
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index 66666b88c15..9be553a8b86 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -296,15 +296,14 @@ module Gitlab
def self.add_call_details(details)
return unless Gitlab::SafeRequestStore[:peek_enabled]
- Gitlab::SafeRequestStore['gitaly_call_details'] ||= {}
- Gitlab::SafeRequestStore['gitaly_call_details'][id] ||= {}
- Gitlab::SafeRequestStore['gitaly_call_details'][id].merge!(details)
+ Gitlab::SafeRequestStore['gitaly_call_details'] ||= []
+ Gitlab::SafeRequestStore['gitaly_call_details'] << details
end
def self.list_call_details
- return {} unless Gitlab::SafeRequestStore[:peek_enabled]
+ return [] unless Gitlab::SafeRequestStore[:peek_enabled]
- Gitlab::SafeRequestStore['gitaly_call_details'] || {}
+ Gitlab::SafeRequestStore['gitaly_call_details'] || []
end
def self.expected_server_version
diff --git a/lib/peek/views/gitaly.rb b/lib/peek/views/gitaly.rb
index 860963ef94f..30f95a10024 100644
--- a/lib/peek/views/gitaly.rb
+++ b/lib/peek/views/gitaly.rb
@@ -23,7 +23,6 @@ module Peek
def details
::Gitlab::GitalyClient.list_call_details
- .values
.sort { |a, b| b[:duration] <=> a[:duration] }
.map(&method(:format_call_details))
end