From 635d927e6d104a9b86e69f06082684ad092479ce Mon Sep 17 00:00:00 2001 From: Alex Kriuchykhin Date: Wed, 2 Oct 2024 11:02:39 +0200 Subject: [PATCH] Remove obsolete devise-async gem, switch to built-in async email delivery (#7643) --- Gemfile | 3 --- Gemfile.lock | 8 -------- app/models/user.rb | 6 +++++- config/initializers/devise_async.rb | 4 ---- 4 files changed, 5 insertions(+), 16 deletions(-) delete mode 100644 config/initializers/devise_async.rb diff --git a/Gemfile b/Gemfile index 8aa125a9d..d8f544316 100644 --- a/Gemfile +++ b/Gemfile @@ -81,9 +81,6 @@ gem 'aws-sdk-lambda' gem 'aws-sdk-rails' gem 'aws-sdk-s3' gem 'delayed_job_active_record' -gem 'devise-async', - git: 'https://github.com/mhfs/devise-async.git', - branch: 'devise-4.x' gem 'image_processing' gem 'img2zpl', git: 'https://github.com/scinote-eln/img2zpl' gem 'rufus-scheduler' diff --git a/Gemfile.lock b/Gemfile.lock index 02710f555..83e1acc9f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,14 +5,6 @@ GIT sneaky-save (0.1.3) activerecord (>= 3.2.0) -GIT - remote: https://github.com/mhfs/devise-async.git - revision: 177f6363a002f7ff28f1d289c8cab7ad8d9cb8c5 - branch: devise-4.x - specs: - devise-async (0.10.2) - devise (>= 4.0) - GIT remote: https://github.com/scinote-eln/canaid revision: bba1b817d1c9b0c7e0440a83d0f62848aabc0a1b diff --git a/app/models/user.rb b/app/models/user.rb index 41c3b9bd5..cb37cc2bc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -8,7 +8,7 @@ class User < ApplicationRecord include ActiveStorageConcerns devise :invitable, :confirmable, :database_authenticatable, :registerable, - :async, :recoverable, :rememberable, :trackable, :validatable, + :recoverable, :rememberable, :trackable, :validatable, :timeoutable, :omniauthable, :lockable, omniauth_providers: Extends::OMNIAUTH_PROVIDERS, stretches: Constants::PASSWORD_STRETCH_FACTOR @@ -635,6 +635,10 @@ class User < ApplicationRecord Rails.configuration.x.core_api_key_enabled end + def send_devise_notification(notification, *args) + devise_mailer.send(notification, self, *args).deliver_later + end + protected def confirmation_required? diff --git a/config/initializers/devise_async.rb b/config/initializers/devise_async.rb deleted file mode 100644 index 0255b5671..000000000 --- a/config/initializers/devise_async.rb +++ /dev/null @@ -1,4 +0,0 @@ -Devise::Async.enabled = true -Devise::Async.backend = :delayed_job -Devise::Async.queue = :devise_email -# Devise::Async.priority = 10 \ No newline at end of file