diff options
| author | Douwe Maan <douwe@selenight.nl> | 2017-12-22 11:38:35 +0100 |
|---|---|---|
| committer | Douwe Maan <douwe@selenight.nl> | 2017-12-22 17:19:50 +0100 |
| commit | 16b8297e77501134cd93a74c3d5c60712930e7fd (patch) | |
| tree | 8373c955431ee30156423626a561ca2cf599e47c /app/models/project.rb | |
| parent | 92e15071c13f65cf7250315f1a138284880b0074 (diff) | |
| download | gitlab-ce-16b8297e77501134cd93a74c3d5c60712930e7fd.tar.gz | |
Execute project hooks and services after commit when moving an issuedm-issue-move-transaction-error
Diffstat (limited to 'app/models/project.rb')
| -rw-r--r-- | app/models/project.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 3440c01b356..f9c640300ff 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -951,7 +951,9 @@ class Project < ActiveRecord::Base def send_move_instructions(old_path_with_namespace) # New project path needs to be committed to the DB or notification will # retrieve stale information - run_after_commit { NotificationService.new.project_was_moved(self, old_path_with_namespace) } + run_after_commit do + NotificationService.new.project_was_moved(self, old_path_with_namespace) + end end def owner @@ -963,15 +965,19 @@ class Project < ActiveRecord::Base end def execute_hooks(data, hooks_scope = :push_hooks) - hooks.public_send(hooks_scope).each do |hook| # rubocop:disable GitlabSecurity/PublicSend - hook.async_execute(data, hooks_scope.to_s) + run_after_commit_or_now do + hooks.public_send(hooks_scope).each do |hook| # rubocop:disable GitlabSecurity/PublicSend + hook.async_execute(data, hooks_scope.to_s) + end end end def execute_services(data, hooks_scope = :push_hooks) # Call only service hooks that are active for this scope - services.public_send(hooks_scope).each do |service| # rubocop:disable GitlabSecurity/PublicSend - service.async_execute(data) + run_after_commit_or_now do + services.public_send(hooks_scope).each do |service| # rubocop:disable GitlabSecurity/PublicSend + service.async_execute(data) + end end end |
