Merge branch 'standalone_develop' of https://gitlink.org.cn/Trustie/forgeplus into standalone_develop

This commit is contained in:
yystopf 2024-06-06 10:01:47 +08:00
commit 814aa55578
3 changed files with 6 additions and 2 deletions

View File

@ -319,7 +319,10 @@ class ProjectsController < ApplicationController
UpdateProjectTopicJob.set(wait: 1.seconds).perform_later(project_id) if project_id.present?
Rails.logger.info "############ mirror status: #{@project&.repository&.mirror&.status} ############"
end
# elsif !@project.common? && @project&.repository&.mirror&.failed?
elsif !@project.common? && @project&.repository&.mirror&.failed?
# 导入失败的项目标记 project.status=0, 在列表中不显示
@project&.update_columns(status: 0) if @project&.status == 1
# Rails.logger.info "############ mirror status: #{@project&.repository&.mirror&.status}"
# Gitea::Repository::DeleteService.new(@project.owner, @project.identifier,current_user.gitea_token).call
# @project.destroy!

View File

@ -22,6 +22,7 @@ class MigrateRemoteRepositoryJob < ApplicationJob
gitea_result = $gitea_client.get_repos_by_owner_repo(repo&.project&.owner&.login, repo&.project&.identifier)
if gitea_result["empty"]
repo&.mirror&.failed!
repo&.project&.update_columns(status: 0)
else
repo&.project&.update_columns(gpid: gitea_result["id"])
repo&.mirror&.succeeded!

View File

@ -38,7 +38,7 @@ class Projects::ListQuery < ApplicationQuery
end
def main_collection
collection = Project.visible
collection = Project.visible.where(status: 1)
# 增加私有组织中项目过滤
collection = collection.joins("left join organization_extensions on organization_extensions.organization_id = projects.user_id")
.where("organization_extensions.visibility is null or organization_extensions.visibility in (0,1)")