diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-03-01 13:51:36 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-03-01 13:51:36 +0300 |
commit | 7aa9ec7aa11fee1de915a15c15b5ee164b2f51a4 (patch) | |
tree | 696fa6fb298a54561960c7e7d43e6a81173bf98b /app/workers | |
parent | bac9bb1866f47f0b1515b8705ea9eba1fa9b9ced (diff) | |
parent | a96ba41f229bd3606696e8e3a6500730e6cb8f63 (diff) |
Merge branch 'dz-system-hooks-plugins' into 'master'
Add ability to use external plugins as system hooks
See merge request gitlab-org/gitlab-ce!17003
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/all_queues.yml | 1 | ||||
-rw-r--r-- | app/workers/plugin_worker.rb | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 28a5e5da037..a9415410f8a 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -84,6 +84,7 @@ - new_note - pages - pages_domain_verification +- plugin - post_receive - process_commit - project_cache diff --git a/app/workers/plugin_worker.rb b/app/workers/plugin_worker.rb new file mode 100644 index 00000000000..bfcc683d99a --- /dev/null +++ b/app/workers/plugin_worker.rb @@ -0,0 +1,15 @@ +class PluginWorker + include ApplicationWorker + + sidekiq_options retry: false + + def perform(file_name, data) + success, message = Gitlab::Plugin.execute(file_name, data) + + unless success + Gitlab::PluginLogger.error("Plugin Error => #{file_name}: #{message}") + end + + true + end +end |