when PostKeeperManager.check_and_update fails, retry (fixes #3699)

This commit is contained in:
Albert Yi
2018-05-09 17:09:04 -07:00
parent c658e7d22a
commit bc4010fe6c
2 changed files with 9 additions and 0 deletions

View File

@@ -11,6 +11,12 @@ class PostArchive < ApplicationRecord
establish_connection (ENV["ARCHIVE_DATABASE_URL"] || "archive_#{Rails.env}".to_sym) if enabled?
self.table_name = "post_versions"
def self.check_for_retry(msg)
if msg =~ /can't get socket descriptor/ && msg =~ /post_versions/
connection.reconnect!
end
end
module SearchMethods
def for_user(user_id)
if user_id