Corrected with rubocop cop 'Lint/Eval'.
This commit is contained in:
parent
67c4215554
commit
3641a41af1
4 changed files with 3 additions and 5 deletions
|
@ -209,7 +209,5 @@ Lint/UnreachableCode:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Lint/ShadowingOuterLocalVariable:
|
Lint/ShadowingOuterLocalVariable:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Lint/Eval:
|
|
||||||
Enabled: false
|
|
||||||
Style/ModuleFunction:
|
Style/ModuleFunction:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Channel < ApplicationModel
|
||||||
channels = Channel.where( 'active = ? AND area LIKE ?', true, '%::Inbound' )
|
channels = Channel.where( 'active = ? AND area LIKE ?', true, '%::Inbound' )
|
||||||
channels.each { |channel|
|
channels.each { |channel|
|
||||||
begin
|
begin
|
||||||
c = eval 'Channel::' + channel[:adapter].upcase + '.new'
|
c = eval 'Channel::' + channel[:adapter].upcase + '.new' # rubocop:disable Lint/Eval
|
||||||
c.fetch(channel)
|
c.fetch(channel)
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
logger.error "can't use " + 'Channel::' + channel[:adapter].upcase
|
logger.error "can't use " + 'Channel::' + channel[:adapter].upcase
|
||||||
|
|
|
@ -6,7 +6,7 @@ module Channel::EmailSend
|
||||||
def self.send(attr, notification = false)
|
def self.send(attr, notification = false)
|
||||||
channel = Channel.find_by( area: 'Email::Outbound', active: true )
|
channel = Channel.find_by( area: 'Email::Outbound', active: true )
|
||||||
begin
|
begin
|
||||||
c = eval 'Channel::' + channel[:adapter] + '.new'
|
c = eval 'Channel::' + channel[:adapter] + '.new' # rubocop:disable Lint/Eval
|
||||||
c.send(attr, channel, notification)
|
c.send(attr, channel, notification)
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
Rails.logger.error "can't use " + 'Channel::' + channel[:adapter]
|
Rails.logger.error "can't use " + 'Channel::' + channel[:adapter]
|
||||||
|
|
|
@ -68,7 +68,7 @@ class Scheduler < ApplicationModel
|
||||||
job.pid = Thread.current.object_id
|
job.pid = Thread.current.object_id
|
||||||
job.save
|
job.save
|
||||||
logger.info "execute #{job.method} (runner #{runner} of #{runner_count}, try_count #{try_count})..."
|
logger.info "execute #{job.method} (runner #{runner} of #{runner_count}, try_count #{try_count})..."
|
||||||
eval job.method()
|
eval job.method() # rubocop:disable Lint/Eval
|
||||||
rescue => e
|
rescue => e
|
||||||
logger.error "execute #{job.method} (runner #{runner} of #{runner_count}, try_count #{try_count}) exited with error #{ e.inspect }"
|
logger.error "execute #{job.method} (runner #{runner} of #{runner_count}, try_count #{try_count}) exited with error #{ e.inspect }"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue