Merge branch 'develop' of https://git.trustie.net/Gitlink/forgeplus into develop

This commit is contained in:
jasder
2021-11-05 11:36:51 +08:00
55 changed files with 299 additions and 331 deletions

View File

@@ -442,6 +442,14 @@ module ApplicationHelper
User.find_by(gitea_uid: gitea_uid)
end
def find_user_in_redis_cache(login, email)
$redis_cache.hgetall("v2-owner-common:#{login}-#{email}")
end
def find_user_in_redis_cache_by_id(id)
$redis_cache.hgetall("v2-owner-common:#{id}")
end
def render_base64_decoded(str)
return nil if str.blank?
Base64.decode64 str

View File

@@ -35,6 +35,16 @@ module RepositoriesHelper
end
end
def render_cache_commit_author(author_json)
Rails.logger.info author_json['Email']
if author_json["name"].present? && author_json["email"].present?
return find_user_in_redis_cache(author_json['name'], author_json['email'])
end
if author_json["Name"].present? && author_json["Email"].present?
return find_user_in_redis_cache(author_json['Name'], author_json['Email'])
end
end
def readme_render_decode64_content(str, path)
return nil if str.blank?
begin