001_refresh.rb (discourse-2.7.13) | : | 001_refresh.rb (discourse-2.8.0) | ||
---|---|---|---|---|
skipping to change at line 12 | skipping to change at line 12 | |||
class SeedData::Refresher | class SeedData::Refresher | |||
@mutex = Mutex.new | @mutex = Mutex.new | |||
def self.refresh! | def self.refresh! | |||
return if @refreshed | return if @refreshed | |||
@mutex.synchronize do | @mutex.synchronize do | |||
return if @refreshed | return if @refreshed | |||
# Fix any bust caches post initial migration | # Fix any bust caches post initial migration | |||
# Not that reset_column_information is not thread safe so we have to becar eful | # Not that reset_column_information is not thread safe so we have to be ca reful | |||
# not to run it concurrently within the same process. | # not to run it concurrently within the same process. | |||
ActiveRecord::Base.connection.tables.each do |table| | ActiveRecord::Base.connection.tables.each do |table| | |||
table.classify.constantize.reset_column_information rescue nil | table.classify.constantize.reset_column_information rescue nil | |||
end | end | |||
@refreshed = true | @refreshed = true | |||
end | end | |||
end | end | |||
end | end | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |