Browse Source

Merge branch 'develop' into standalone_develop

pull/313/head
yystopf 3 years ago
parent
commit
872a2b334b
3 changed files with 5 additions and 2 deletions
  1. +1
    -1
      Gemfile
  2. +1
    -1
      app/controllers/project_rank_controller.rb
  3. +3
    -0
      app/models/project.rb

+ 1
- 1
Gemfile View File

@@ -139,4 +139,4 @@ gem 'doorkeeper'

gem 'doorkeeper-jwt'

gem 'gitea-client', '~> 0.10.6'
gem 'gitea-client', '~> 0.11.1'

+ 1
- 1
app/controllers/project_rank_controller.rb View File

@@ -4,7 +4,7 @@ class ProjectRankController < ApplicationController
$redis_cache.zunionstore("recent-days-project-rank", get_timeable_key_names)
deleted_data = $redis_cache.smembers("v2-project-rank-deleted")
$redis_cache.zrem("recent-days-project-rank", deleted_data) unless deleted_data.blank?
@project_rank = $redis_cache.zrevrange("recent-days-project-rank", 0, 4, withscores: true)
@project_rank = $redis_cache.zrevrange("recent-days-project-rank", 0, 9, withscores: true)
rescue Exception => e
@project_rank = []
end


+ 3
- 0
app/models/project.rb View File

@@ -175,6 +175,9 @@ class Project < ApplicationRecord
$redis_cache.srem("v2-project-rank-deleted", self.id)
end
end
if !self.common?
$redis_cache.srem("v2-project-rank-deleted", self.id)
end
end

def decre_project_common


Loading…
Cancel
Save