mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
ADD sync mirror repo api
This commit is contained in:
8
app/jobs/sync_mirrored_repository_job.rb
Normal file
8
app/jobs/sync_mirrored_repository_job.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class SyncMirroredRepositoryJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(repo, current_user)
|
||||
result = Gitea::Repository::SyncMirroredService.new(repo.user.login, repo.identifier, token: current_user.gitea_token).call
|
||||
repo&.mirror.set_status! if result[:status] === 200
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user