Commit fa0860e5 authored by James Fargher's avatar James Fargher

Remove kwargs from storage move worker

Sidekiq does not support kwargs
parent f6dd05a5
......@@ -39,8 +39,9 @@ class ProjectRepositoryStorageMove < ApplicationRecord
after_transition initial: :scheduled do |storage_move, _|
storage_move.run_after_commit do
ProjectUpdateRepositoryStorageWorker.perform_async(
storage_move.project_id, storage_move.destination_storage_name,
repository_storage_move_id: storage_move.id
storage_move.project_id,
storage_move.destination_storage_name,
storage_move.id
)
end
end
......
......@@ -5,7 +5,7 @@ class ProjectUpdateRepositoryStorageWorker # rubocop:disable Scalability/Idempot
feature_category :gitaly
def perform(project_id, new_repository_storage_key, repository_storage_move_id: nil)
def perform(project_id, new_repository_storage_key, repository_storage_move_id = nil)
repository_storage_move =
if repository_storage_move_id
ProjectRepositoryStorageMove.find(repository_storage_move_id)
......
---
title: Remove kwargs from storage move worker
merge_request: 31412
author:
type: fixed
......@@ -46,7 +46,7 @@ RSpec.describe ProjectRepositoryStorageMove, type: :model do
context 'and transits to scheduled' do
it 'triggers ProjectUpdateRepositoryStorageWorker' do
expect(ProjectUpdateRepositoryStorageWorker).to receive(:perform_async).with(project.id, 'test_second_storage', repository_storage_move_id: storage_move.id)
expect(ProjectUpdateRepositoryStorageWorker).to receive(:perform_async).with(project.id, 'test_second_storage', storage_move.id)
storage_move.schedule!
end
......
......@@ -2844,7 +2844,7 @@ describe Project do
end
it 'schedules the transfer of the repository to the new storage and locks the project' do
expect(ProjectUpdateRepositoryStorageWorker).to receive(:perform_async).with(project.id, 'test_second_storage', repository_storage_move_id: anything)
expect(ProjectUpdateRepositoryStorageWorker).to receive(:perform_async).with(project.id, 'test_second_storage', anything)
project.change_repository_storage('test_second_storage')
project.save!
......
......@@ -40,7 +40,7 @@ describe ProjectUpdateRepositoryStorageWorker do
expect(service).to receive(:execute)
expect do
subject.perform(nil, nil, repository_storage_move_id: repository_storage_move.id)
subject.perform(nil, nil, repository_storage_move.id)
end.not_to change(ProjectRepositoryStorageMove, :count)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment