Sha256: a3e6356869fb4584e8d06cc361af8d7fbabdd4394314384f0e90fdae6d97a344

Contents?: true

Size: 833 Bytes

Versions: 7

Compression:

Stored size: 833 Bytes

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_sync 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

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
deimos-ruby-1.4.0.pre.beta7 lib/tasks/deimos.rake
deimos-ruby-1.4.0.pre.beta6 lib/tasks/deimos.rake
deimos-ruby-1.4.0.pre.beta5 lib/tasks/deimos.rake
deimos-ruby-1.4.0.pre.beta4 lib/tasks/deimos.rake
deimos-ruby-1.4.0.pre.beta3 lib/tasks/deimos.rake
deimos-ruby-1.4.0.pre.beta2 lib/tasks/deimos.rake
deimos-ruby-1.4.0.pre.beta1 lib/tasks/deimos.rake