mirror of
https://github.com/discourse/discourse.git
synced 2025-06-13 18:04:35 +08:00
BUGFIX: reload site settings on rails reload in dev
This commit is contained in:
@ -1,7 +1,17 @@
|
|||||||
RailsMultisite::ConnectionManagement.each_connection do
|
reload_settings = lambda {
|
||||||
begin
|
RailsMultisite::ConnectionManagement.each_connection do
|
||||||
SiteSetting.refresh!
|
begin
|
||||||
rescue ActiveRecord::StatementInvalid
|
SiteSetting.refresh!
|
||||||
# This will happen when migrating a new database
|
rescue ActiveRecord::StatementInvalid
|
||||||
|
# This will happen when migrating a new database
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
if Rails.configuration.cache_classes
|
||||||
|
reload_settings.call
|
||||||
|
else
|
||||||
|
ActionDispatch::Reloader.to_prepare do
|
||||||
|
reload_settings.call
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user