From 6b7f3c186427a61c74994df9dea320d2de7f10e6 Mon Sep 17 00:00:00 2001 From: Raimundo Herrera Date: Sat, 1 Feb 2020 19:56:33 -0300 Subject: [PATCH] fix(mailer): avoid sidekiq repeated installation closes #253 --- CHANGELOG.md | 1 + lib/potassium/recipes/mailer.rb | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63f6b97f..43684d04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Features: Fix: - Correctly use cache for bundle dependencies in CircleCI build [#244](https://github.com/platanus/potassium/pull/244) and [#258](https://github.com/platanus/potassium/pull/258) - Fix model auto annotate [#260](https://github.com/platanus/potassium/pull/260) + - Fix sidekiq repeated installation on potassium create if selecting mailer [#262](https://github.com/platanus/potassium/pull/262) ## 5.2.3 diff --git a/lib/potassium/recipes/mailer.rb b/lib/potassium/recipes/mailer.rb index 4c42fa8b..68d2a37d 100644 --- a/lib/potassium/recipes/mailer.rb +++ b/lib/potassium/recipes/mailer.rb @@ -24,8 +24,11 @@ def create dependencies(email_service) config(email_service) - background_processor = load_recipe(:background_processor) - background_processor.add_sidekiq unless background_processor.installed? + background_processor_recipe = load_recipe(:background_processor) + background_processor_answer = get(:background_processor) + + background_processor_recipe.add_sidekiq unless background_processor_recipe.installed? || + background_processor_answer end def install