[Logilogi-svn] SF.net SVN: logilogi:[1780] trunk
Status: Beta
Brought to you by:
wybow
|
From: <wy...@us...> - 2010-12-21 15:26:53
|
Revision: 1780
http://logilogi.svn.sourceforge.net/logilogi/?rev=1780&view=rev
Author: wybow
Date: 2010-12-21 15:26:45 +0000 (Tue, 21 Dec 2010)
Log Message:
-----------
Introduced graceful failure if log.logilogi.org is not running
Modified Paths:
--------------
trunk/app/models/log_log_message.rb
trunk/app/models/log_log_subscription.rb
trunk/db/schema.rb
Modified: trunk/app/models/log_log_message.rb
===================================================================
--- trunk/app/models/log_log_message.rb 2010-10-11 22:54:26 UTC (rev 1779)
+++ trunk/app/models/log_log_message.rb 2010-12-21 15:26:45 UTC (rev 1780)
@@ -20,5 +20,14 @@
end
end
+ alias __save__ save
+ def save
+ begin
+ self.__save__
+ rescue
+ ActiveRecord::Base.logger.error "Error: LogLog enabled, but not found.\n"
+ end
+ end
+
self.initialize_global_config
end
Modified: trunk/app/models/log_log_subscription.rb
===================================================================
--- trunk/app/models/log_log_subscription.rb 2010-10-11 22:54:26 UTC (rev 1779)
+++ trunk/app/models/log_log_subscription.rb 2010-12-21 15:26:45 UTC (rev 1780)
@@ -20,22 +20,26 @@
def self.send_out_alerts(period)
sent_to = []
- LogLogSubscription.find_each(:conditions => ['period = ?', period]) do |lls|
- url = URI.parse(GlobalConfig.log_log_site +
- "/channels/" + lls.channel + "/periods/" + period + ".txt")
- begin
- page = Net::HTTP.get_response(url)
- periodical = page.body
- if periodical =~ /[^\s]/
- if lls.channel == "logis"
- Notifier.deliver_logis_log(lls.user, period, periodical)
- else
- Notifier.deliver_personalized_log(lls.user, period, periodical)
+ begin
+ LogLogSubscription.find_each(:conditions => ['period = ?', period]) do |lls|
+ url = URI.parse(GlobalConfig.log_log_site +
+ "/channels/" + lls.channel + "/periods/" + period + ".txt")
+ begin
+ page = Net::HTTP.get_response(url)
+ periodical = page.body
+ if periodical =~ /[^\s]/
+ if lls.channel == "logis"
+ Notifier.deliver_logis_log(lls.user, period, periodical)
+ else
+ Notifier.deliver_personalized_log(lls.user, period, periodical)
+ end
+ sent_to << lls.user.name
end
- sent_to << lls.user.name
+ rescue
end
- rescue
end
+ rescue
+ ActiveRecord::Base.logger.error "LogLog enabled, but not found.\n"
end
if sent_to.empty?
sent_to = ['Nobody']
@@ -51,4 +55,13 @@
"Sent personalized #{period} to: " + sent_to.join(', '))
end
end
+
+ alias __save__ save
+ def save
+ begin
+ self.__save__
+ rescue
+ ActiveRecord::Base.logger.error "Error: LogLog enabled, but not found.\n"
+ end
+ end
end
Modified: trunk/db/schema.rb
===================================================================
--- trunk/db/schema.rb 2010-10-11 22:54:26 UTC (rev 1779)
+++ trunk/db/schema.rb 2010-12-21 15:26:45 UTC (rev 1780)
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20100810165341) do
+ActiveRecord::Schema.define(:version => 20100923165007) do
create_table "acts_as_xapian_jobs", :force => true do |t|
t.string "model", :null => false
@@ -20,11 +20,11 @@
add_index "acts_as_xapian_jobs", ["model", "model_id"], :name => "index_acts_as_xapian_jobs_on_model_and_model_id", :unique => true
create_table "annotations", :force => true do |t|
- t.integer "logi_id", :null => false
- t.integer "user_id", :null => false
- t.string "message", :null => false
- t.string "position_ranges_string", :limit => 80, :null => false
- t.datetime "created_at", :null => false
+ t.integer "logi_id", :null => false
+ t.integer "user_id", :null => false
+ t.string "message", :null => false
+ t.string "position_ranges_string", :limit => 2048, :null => false
+ t.datetime "created_at", :null => false
end
add_index "annotations", ["logi_id"], :name => "index_annotations_on_logi_id"
@@ -40,12 +40,12 @@
add_index "commentings", ["to_logi_id"], :name => "index_commentings_on_to_logi_id"
create_table "external_links", :force => true do |t|
- t.integer "logi_id", :null => false
- t.integer "user_id", :null => false
- t.string "text", :null => false
- t.string "url", :null => false
- t.string "position_ranges_string", :limit => 80, :null => false
- t.datetime "created_at", :null => false
+ t.integer "logi_id", :null => false
+ t.integer "user_id", :null => false
+ t.string "text", :null => false
+ t.string "url", :null => false
+ t.string "position_ranges_string", :limit => 2048, :null => false
+ t.datetime "created_at", :null => false
end
add_index "external_links", ["logi_id"], :name => "index_external_links_on_logi_id"
@@ -113,16 +113,16 @@
add_index "link_matches", ["logi_id"], :name => "index_link_matches_on_logi_id"
create_table "links", :force => true do |t|
- t.integer "user_id", :null => false
- t.integer "from_logi_id", :null => false
+ t.integer "user_id", :null => false
+ t.integer "from_logi_id", :null => false
t.integer "to_logi_id"
t.integer "to_logi_version_nr"
t.string "requested_tags_string", :limit => 120
t.string "received_tags_string", :limit => 120
- t.string "position_ranges_string", :limit => 512, :null => false
- t.integer "stance", :null => false
- t.datetime "created_at", :null => false
- t.boolean "re_resolve", :default => false, :null => false
+ t.string "position_ranges_string", :limit => 2048, :null => false
+ t.integer "stance", :null => false
+ t.datetime "created_at", :null => false
+ t.boolean "re_resolve", :default => false, :null => false
end
add_index "links", ["from_logi_id", "to_logi_id"], :name => "index_links_on_from_logi_id_and_to_logi_id"
@@ -139,11 +139,11 @@
add_index "log_log_subscriptions", ["user_id"], :name => "index_log_log_subscriptions_on_user_id"
create_table "logi_versions", :force => true do |t|
- t.integer "logi_id", :null => false
- t.integer "editor_user_id", :null => false
- t.integer "nr", :null => false
- t.string "position_ranges_string", :limit => 8192, :null => false
- t.datetime "created_at", :null => false
+ t.integer "logi_id", :null => false
+ t.integer "editor_user_id", :null => false
+ t.integer "nr", :null => false
+ t.string "position_ranges_string", :limit => 16384, :null => false
+ t.datetime "created_at", :null => false
end
add_index "logi_versions", ["logi_id", "nr"], :name => "index_logi_versions_on_logi_id_and_nr", :unique => true
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|