mirror of
https://github.com/ditkrg/rabbit_carrots.git
synced 2026-01-22 22:06:40 +00:00
Fixes rubocop offenses
This commit is contained in:
parent
8a95f69556
commit
54025a5aa4
@ -5,9 +5,11 @@ namespace :rabbit_carrots do
|
|||||||
task eat: :environment do
|
task eat: :environment do
|
||||||
Rails.application.eager_load!
|
Rails.application.eager_load!
|
||||||
|
|
||||||
|
# rubocop:disable Lint/ConstantDefinitionInBlock
|
||||||
DatabaseAgonsticNotNullViolation = defined?(ActiveRecord) ? ActiveRecord::NotNullViolation : RabbitCarrots::EventHandlers::Errors::PlaceholderError
|
DatabaseAgonsticNotNullViolation = defined?(ActiveRecord) ? ActiveRecord::NotNullViolation : RabbitCarrots::EventHandlers::Errors::PlaceholderError
|
||||||
DatabaseAgonsticConnectionNotEstablished = defined?(ActiveRecord) ? ActiveRecord::ConnectionNotEstablished : Mongo::Error::SocketError
|
DatabaseAgonsticConnectionNotEstablished = defined?(ActiveRecord) ? ActiveRecord::ConnectionNotEstablished : Mongo::Error::SocketError
|
||||||
DatabaseAgnosticRecordInvalid = defined?(ActiveRecord) ? ActiveRecord::RecordInvalid : Mongoid::Errors::Validations
|
DatabaseAgnosticRecordInvalid = defined?(ActiveRecord) ? ActiveRecord::RecordInvalid : Mongoid::Errors::Validations
|
||||||
|
# rubocop:enable Lint/ConstantDefinitionInBlock
|
||||||
|
|
||||||
channels = RabbitCarrots.configuration.routing_key_mappings.map do |mapping|
|
channels = RabbitCarrots.configuration.routing_key_mappings.map do |mapping|
|
||||||
# This will be supplied in initializer. At that time, the Handler will not be available to be loaded and will throw Uninitialized Constant
|
# This will be supplied in initializer. At that time, the Handler will not be available to be loaded and will throw Uninitialized Constant
|
||||||
@ -32,7 +34,7 @@ namespace :rabbit_carrots do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_task(queue_name:, queue_arguments: {}, handler_class:, routing_keys:)
|
def run_task(queue_name:, handler_class:, routing_keys:, queue_arguments: {})
|
||||||
RabbitCarrots::Connection.instance.channel.with do |channel|
|
RabbitCarrots::Connection.instance.channel.with do |channel|
|
||||||
exchange = channel.topic(RabbitCarrots.configuration.event_bus_exchange_name, durable: true)
|
exchange = channel.topic(RabbitCarrots.configuration.event_bus_exchange_name, durable: true)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user