Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b7131fd5
Commit
b7131fd5
authored
4 years ago
by
Gary Holtz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert to normal transaction block
parent
27d21077
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
app/services/merge_requests/post_merge_service.rb
app/services/merge_requests/post_merge_service.rb
+8
-8
No files found.
app/services/merge_requests/post_merge_service.rb
View file @
b7131fd5
...
...
@@ -11,7 +11,7 @@ module MergeRequests
# return if merge_request.merged? # nothing to do, this worker has already run at least once
# These operations need to happen transactionally
ActiveRecord
::
Base
.
transaction
do
ActiveRecord
::
Base
.
transaction
(
requires_new:
true
)
do
merge_request
.
mark_as_merged
create_event
(
merge_request
)
create_note
(
merge_request
)
...
...
@@ -20,15 +20,15 @@ module MergeRequests
# Better to have duplicate notifications than no notifications.
todo_service
.
merge_merge_request
(
merge_request
,
current_user
)
notification_service
.
merge_mr
(
merge_request
,
current_user
)
# These operations are idempotent so can be safely run multiple times
close_issues
(
merge_request
)
invalidate_cache_counts
(
merge_request
,
users:
merge_request
.
assignees
)
merge_request
.
update_project_counter_caches
delete_non_latest_diffs
(
merge_request
)
cleanup_environments
(
merge_request
)
end
# These operations are idempotent so can be safely run multiple times
close_issues
(
merge_request
)
invalidate_cache_counts
(
merge_request
,
users:
merge_request
.
assignees
)
merge_request
.
update_project_counter_caches
delete_non_latest_diffs
(
merge_request
)
cleanup_environments
(
merge_request
)
# Anything after this point will be executed at-most-once. Less important activity only
# TODO: make all the work in here a separate sidekiq job so it can go in the transaction
execute_hooks
(
merge_request
,
'merge'
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment