diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-08-18 15:46:36 -0700 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-08-18 15:46:36 -0700 |
commit | f76eac56b9d7d4ae61010cddcca68682824b2239 (patch) | |
tree | 703e9cb22b0e44880775d0a4bb5bdbebc87a563f /app/workers | |
parent | 204914983a015170ea1ca4cf6040c04d9a1ec1d9 (diff) | |
download | gitlab-ce-f76eac56b9d7d4ae61010cddcca68682824b2239.tar.gz |
Reply by email POC
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/email_receiver_worker.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/workers/email_receiver_worker.rb b/app/workers/email_receiver_worker.rb new file mode 100644 index 00000000000..e44a430f6bc --- /dev/null +++ b/app/workers/email_receiver_worker.rb @@ -0,0 +1,22 @@ +class EmailReceiverWorker + include Sidekiq::Worker + + sidekiq_options queue: :incoming_email + + def perform(raw) + return unless Gitlab.config.reply_by_email.enabled + + # begin + Gitlab::EmailReceiver.new(raw).process + # rescue => e + # handle_failure(raw, e) + # end + end + + private + + def handle_failure(raw, e) + # TODO: Handle better. + Rails.logger.warn("Email can not be processed: #{e}\n\n#{raw}") + end +end |