Skip to content

Commit 445c924

Browse files
committed
Fix cache not updating across all benchmark types.
1 parent 9b9e8e7 commit 445c924

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/controllers/repos_controller.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ def show
2222
end
2323

2424
cached_charts_columns = $redis.get("#{@form_result_type}_#{@benchmark_run_display_count}")
25+
repo_commits_count = @repo.commits.count
2526

2627
@charts =
27-
if $redis.get('commits_count').to_i == Commit.count && cached_charts_columns
28+
if $redis.get('commits_count').to_i == repo_commits_count && cached_charts_columns
2829
cached_charts_columns = JSON.parse(cached_charts_columns)
2930
cached_charts_columns.each { |h| h.symbolize_keys! }
3031
cached_charts_columns
3132
else
32-
$redis.set('commits_count', Commit.count)
33+
$redis.set('commits_count', repo_commits_count)
3334
commits_ids = @repo.commits.limit(@benchmark_run_display_count).pluck(:id)
3435

3536
charts_columns = [@form_result_type, "#{@form_result_type}_memory"].each_with_index.map do |result_type, index|

0 commit comments

Comments
 (0)