Browse Source

fixed 项目名称,标识,所有者变化时重置缓存

pull/343/head
xxq250 3 years ago
parent
commit
2aeaee8479
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      app/controllers/projects_controller.rb

+ 7
- 0
app/controllers/projects_controller.rb View File

@@ -238,6 +238,13 @@ class ProjectsController < ApplicationController
def simple
# 为了缓存活跃项目的基本信息,后续删除
Cache::V2::ProjectCommonService.new(@project.id).read
# 项目名称,标识,所有者变化时重置缓存
project_common = $redis_cache.hgetall("v2-project-common:#{@project.id}")
if project_common.present?
if project_common["name"] != @project.name || project_common["identifier"] != @project.identifier || project_common["owner_id"] != @project.user_id
Cache::V2::ProjectCommonService.new(@project.id).reset
end
end
json_response(@project, current_user)
end



Loading…
Cancel
Save