trabajo-afectivo/app/models/channel.rb

21 lines
600 B
Ruby
Raw Normal View History

2014-02-03 19:23:00 +00:00
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
class Channel < ApplicationModel
store :options
2012-04-10 14:06:46 +00:00
def self.fetch
channels = Channel.where( 'active = ? AND area LIKE ?', true, '%::Inbound' )
channels.each { |channel|
2012-04-10 14:06:46 +00:00
begin
c = eval 'Channel::' + channel[:adapter].upcase + '.new' # rubocop:disable Lint/Eval
2012-04-10 14:06:46 +00:00
c.fetch(channel)
rescue Exception => e
2015-05-04 18:58:28 +00:00
logger.error "can't use " + 'Channel::' + channel[:adapter].upcase
logger.error e.inspect
logger.error e.backtrace
2014-06-22 07:00:09 +00:00
c.disconnect
2012-04-10 14:06:46 +00:00
end
}
end
end