We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8d9dc4 commit 9491f42Copy full SHA for 9491f42
app/models/user.rb
@@ -366,7 +366,7 @@ def github_repositories
366
end
367
368
def github_repositories_cache_key
369
- "github-repos:#{github}"
+ "github-repos:#{github}:1"
370
371
372
def self.fetch_github_repositories(user_id)
@@ -396,7 +396,7 @@ def self.fetch_github_repositories(user_id)
396
description: a1['description']
397
}
398
399
- items = items.sort_by { |item| item[:watchers] }.take(10)
+ items = items.sort { |a, b| b[:watchers] <=> a[:watchers] }.take(10)
400
$file_store.write(user.github_repositories_cache_key, items, expires_in: 15.days)
401
items
402
0 commit comments