0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-04 10:39:43 +08:00
discourse/db/fixtures/001_refresh.rb
Jarek Radosz fbb3bf3fe8
DEV: Enable Style/RedundantBegin rubocop rule (#40096)
(to be enabled in the shared config)

best reviewed with whitespace disabled
2026-05-19 18:44:54 +02:00

26 lines
637 B
Ruby
Vendored

# frozen_string_literal: true
class SeedData::Refresher
@mutex = Mutex.new
def self.refresh!
return if @refreshed
@mutex.synchronize do
return if @refreshed
# Fix any bust caches post initial migration
# Not that reset_column_information is not thread safe so we have to be careful
# not to run it concurrently within the same process.
ActiveRecord::Base.connection.tables.each do |table|
table.classify.constantize.reset_column_information
rescue StandardError
nil
end
@refreshed = true
end
end
end
SeedData::Refresher.refresh!
SiteSetting.refresh!