fix: educoder file visit delay
This commit is contained in:
parent
beccac652f
commit
0d64768e4b
|
@ -80,6 +80,7 @@ class RepositoriesController < ApplicationController
|
||||||
"commits" => [{}]
|
"commits" => [{}]
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
begin
|
||||||
@sub_entries = Educoder::Repository::Entries::ListService.call(@project&.project_educoder&.repo_name, {path: file_path_uri})
|
@sub_entries = Educoder::Repository::Entries::ListService.call(@project&.project_educoder&.repo_name, {path: file_path_uri})
|
||||||
if @sub_entries.blank?
|
if @sub_entries.blank?
|
||||||
@sub_entries = Educoder::Repository::Entries::GetService.call(@project&.project_educoder&.repo_name, file_path_uri)
|
@sub_entries = Educoder::Repository::Entries::GetService.call(@project&.project_educoder&.repo_name, file_path_uri)
|
||||||
|
@ -93,6 +94,9 @@ class RepositoriesController < ApplicationController
|
||||||
"commits" => [{}]
|
"commits" => [{}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
rescue
|
||||||
|
return render_error('该文件暂未开放,敬请期待.')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@path = Gitea.gitea_config[:domain]+"/#{@project.owner.login}/#{@project.identifier}/raw/branch/#{@ref}/"
|
@path = Gitea.gitea_config[:domain]+"/#{@project.owner.login}/#{@project.identifier}/raw/branch/#{@ref}/"
|
||||||
|
@ -129,8 +133,7 @@ class RepositoriesController < ApplicationController
|
||||||
def commit
|
def commit
|
||||||
@sha = params[:sha]
|
@sha = params[:sha]
|
||||||
if @project.educoder?
|
if @project.educoder?
|
||||||
@commit = {}
|
return render_error('暂未开放,敬请期待.')
|
||||||
@commit_diff ={}
|
|
||||||
else
|
else
|
||||||
@commit = Gitea::Repository::Commits::GetService.call(@owner.login, @repository.identifier, @sha, current_user&.gitea_token)
|
@commit = Gitea::Repository::Commits::GetService.call(@owner.login, @repository.identifier, @sha, current_user&.gitea_token)
|
||||||
@commit_diff = Gitea::Repository::Commits::GetService.call(@owner.login, @repository.identifier, @sha, current_user&.gitea_token, {diff: true})
|
@commit_diff = Gitea::Repository::Commits::GetService.call(@owner.login, @repository.identifier, @sha, current_user&.gitea_token, {diff: true})
|
||||||
|
|
Loading…
Reference in New Issue