Improved error handling of channel streaming.
This commit is contained in:
parent
4c7309303f
commit
38ef22e4e5
2 changed files with 17 additions and 2 deletions
|
@ -143,6 +143,7 @@ stream all accounts
|
||||||
channels = Channel.where('active = ? AND area LIKE ?', true, '%::Account')
|
channels = Channel.where('active = ? AND area LIKE ?', true, '%::Account')
|
||||||
channels.each do |channel|
|
channels.each do |channel|
|
||||||
adapter = channel.options[:adapter]
|
adapter = channel.options[:adapter]
|
||||||
|
next if adapter.blank?
|
||||||
driver_class = Object.const_get("Channel::Driver::#{adapter.to_classname}")
|
driver_class = Object.const_get("Channel::Driver::#{adapter.to_classname}")
|
||||||
next if !driver_class.respond_to?(:streamable?)
|
next if !driver_class.respond_to?(:streamable?)
|
||||||
next if !driver_class.streamable?
|
next if !driver_class.streamable?
|
||||||
|
|
|
@ -224,6 +224,20 @@ example
|
||||||
@imap.disconnect()
|
@imap.disconnect()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
=begin
|
||||||
|
|
||||||
|
Channel::Driver::Imap.streamable?
|
||||||
|
|
||||||
|
returns
|
||||||
|
|
||||||
|
true|false
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
def self.streamable?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def already_imported?(message_id, message_meta, count, count_all, keep_on_server)
|
def already_imported?(message_id, message_meta, count, count_all, keep_on_server)
|
||||||
|
|
Loading…
Reference in a new issue