Sha256: d515e536887df94c31e4609911292ebb9994b6923e40a85fe9574adee0edb18b
Contents?: true
Size: 1 KB
Versions: 36
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true require 'phobos' require 'phobos/cli' namespace :deimos do desc 'Starts Deimos in the rails environment' task start: :environment do Deimos.configure do |config| config.producers.backend = :kafka if config.producers.backend == :kafka_async end ENV['DEIMOS_RAKE_TASK'] = 'true' STDOUT.sync = true Rails.logger.info('Running deimos:start rake task.') Phobos::CLI::Commands.start(%w(start --skip_config)) end desc 'Starts the Deimos database producer' task db_producer: :environment do ENV['DEIMOS_RAKE_TASK'] = 'true' STDOUT.sync = true Rails.logger.info('Running deimos:db_producer rake task.') thread_count = ENV['THREAD_COUNT'].to_i.zero? ? 1 : ENV['THREAD_COUNT'].to_i Deimos.start_db_backend!(thread_count: thread_count) end task db_poller: :environment do ENV['DEIMOS_RAKE_TASK'] = 'true' STDOUT.sync = true Rails.logger.info('Running deimos:db_poller rake task.') Deimos::Utils::DbPoller.start! end end
Version data entries
36 entries across 36 versions & 2 rubygems