lib/potassium/recipes/background_processor.rb in potassium-7.0.0 vs lib/potassium/recipes/background_processor.rb in potassium-7.1.0
- old
+ new
@@ -12,12 +12,10 @@
end
def create
if get(:background_processor)
add_sidekiq
- add_docker_compose_redis_config
- set_redis_dot_env
end
end
def install
ask
@@ -38,11 +36,10 @@
add_readme_section :internal_dependencies, :sidekiq
recipe.edit_procfile("bundle exec sidekiq")
append_to_file(".env.development", "DB_POOL=25\n")
template("../assets/sidekiq.rb.erb", "config/initializers/sidekiq.rb", force: true)
copy_file("../assets/sidekiq.yml", "config/sidekiq.yml", force: true)
- copy_file("../assets/redis.yml", "config/redis.yml", force: true)
recipe.mount_sidekiq_routes
end
end
def edit_procfile(cmd)
@@ -65,36 +62,9 @@
HERE
end
end
private
-
- def add_docker_compose_redis_config
- compose = DockerHelpers.new('docker-compose.yml')
-
- service_definition =
- <<~YAML
- image: redis
- ports:
- - 6379
- volumes:
- - redis_data:/data
- YAML
-
- compose.add_service('redis', service_definition)
- compose.add_volume('redis_data')
- end
-
- def set_redis_dot_env
- append_to_file(
- '.env.development',
- <<~TEXT
- REDIS_HOST=127.0.0.1
- REDIS_PORT=COMMAND_EXPAND(make services-port SERVICE=redis PORT=6379)
- REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}/1
- TEXT
- )
- end
def enabled_mailer?
mailer_answer = get(:email_service)
mailer_answer && ![:none, :None].include?(mailer_answer.to_sym)
end