return unless BufferManager.instantiated?
broken_sources = Index.usual_sources.select { |s| s.error.is_a? FatalSourceError }
+ File.open("goat", "w") { |f| f.puts Kernel.caller }
unless broken_sources.empty?
- BufferManager.spawn "Broken source notification", TextMode.new(<<EOM), opts
+ BufferManager.spawn_unless_exists("Broken source notification for #{broken_sources.join(',')}", opts) do
+ TextMode.new(<<EOM)
Source error notification
-------------------------
#{broken_sources.map { |s| "Source: " + s.to_s + "\n Error: " + s.error.message.wrap(70).join("\n ")}.join("\n\n")}
EOM
#' stupid ruby-mode
+ end
end
desynced_sources = Index.usual_sources.select { |s| s.error.is_a? OutOfSyncSourceError }
unless desynced_sources.empty?
- BufferManager.spawn "Out-of-sync source notification", TextMode.new(<<EOM), opts
+ BufferManager.spawn_unless_exists("Out-of-sync source notification for #{broken_sources.join(',')}", opts) do
+ TextMode.new(<<EOM)
Out-of-sync source notification
-------------------------------
end}
EOM
#' stupid ruby-mode
+ end
end
end
## TODO: don't regen text completely
Redwood::reporting_thread do
num = t.size
- BufferManager.say("Loading message bodies...") do |sid|
+ message = "Loading #{num.pluralize 'message body'}..."
+ BufferManager.say(message) do |sid|
t.each_with_index do |(m, *o), i|
next unless m
- BufferManager.say "Loading message bodies... (#{i + 1}/#{num})", sid if t.size > 1
+ BufferManager.say "#{message} (#{i}/#{num})", sid if t.size > 1
m.load_from_source!
end
end
yield "Loading from #{source}... " unless source.done? || source.has_errors?
rescue SourceError => e
Redwood::log "problem getting messages from #{source}: #{e.message}"
- Redwood::report_broken_sources
+ Redwood::report_broken_sources :force_to_top => true
next
end
end
rescue SourceError => e
Redwood::log "problem getting messages from #{source}: #{e.message}"
- Redwood::report_broken_sources
+ Redwood::report_broken_sources :force_to_top => true
end
end
end