summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2017-08-10 18:01:01 -0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2017-08-28 15:48:09 -0300
commit4f17c6b7633c65a9d51dbcd9193914013707e226 (patch)
tree8c4523f15e7b40a9b7852cc5413669144370f263 /app/services
parentd7f61bae8b498a09180bb7e782a687ae2d0c3bae (diff)
downloadgitlab-ce-4f17c6b7633c65a9d51dbcd9193914013707e226.tar.gz
Track enqueued and ongoing MRs
Diffstat (limited to 'app/services')
-rw-r--r--app/services/merge_requests/merge_service.rb3
-rw-r--r--app/services/merge_requests/merge_when_pipeline_succeeds_service.rb2
-rw-r--r--app/services/merge_requests/update_service.rb2
3 files changed, 5 insertions, 2 deletions
diff --git a/app/services/merge_requests/merge_service.rb b/app/services/merge_requests/merge_service.rb
index 5be749cd6a0..aac1e7e19c3 100644
--- a/app/services/merge_requests/merge_service.rb
+++ b/app/services/merge_requests/merge_service.rb
@@ -31,6 +31,9 @@ module MergeRequests
end
rescue MergeError => e
log_merge_error(e.message, save_message_on_model: true)
+ ensure
+ # Make sure to clean up merge_jid in the end of the merge process.
+ merge_request.update_column(:merge_jid, nil)
end
private
diff --git a/app/services/merge_requests/merge_when_pipeline_succeeds_service.rb b/app/services/merge_requests/merge_when_pipeline_succeeds_service.rb
index aed5287940e..57c82e39410 100644
--- a/app/services/merge_requests/merge_when_pipeline_succeeds_service.rb
+++ b/app/services/merge_requests/merge_when_pipeline_succeeds_service.rb
@@ -30,7 +30,7 @@ module MergeRequests
next
end
- MergeWorker.perform_async(merge_request.id, merge_request.merge_user_id, merge_request.merge_params)
+ merge_request.async_merge(merge_request.merge_user_id, merge_request.merge_params)
end
end
diff --git a/app/services/merge_requests/update_service.rb b/app/services/merge_requests/update_service.rb
index 75a65aecd1a..6563a4101a3 100644
--- a/app/services/merge_requests/update_service.rb
+++ b/app/services/merge_requests/update_service.rb
@@ -83,7 +83,7 @@ module MergeRequests
if merge_request.head_pipeline && merge_request.head_pipeline.active?
MergeRequests::MergeWhenPipelineSucceedsService.new(project, current_user).execute(merge_request)
else
- MergeWorker.perform_async(merge_request.id, current_user.id, {})
+ merge_request.async_merge(current_user.id, {})
end
end