2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-02-09 00:58:56 -06:00
|
|
|
# load up git version into memory
|
|
|
|
# this way if it changes underneath we still have
|
|
|
|
# the original version
|
|
|
|
Discourse.git_version
|
|
|
|
|
2019-06-12 21:58:27 -05:00
|
|
|
if GlobalSetting.skip_redis?
|
2023-01-07 05:59:28 -06:00
|
|
|
require "site_settings/local_process_provider"
|
2019-06-12 21:58:27 -05:00
|
|
|
Rails.cache = Discourse.cache
|
2022-03-21 09:28:52 -05:00
|
|
|
Rails.application.config.to_prepare do
|
|
|
|
SiteSetting.provider = SiteSettings::LocalProcessProvider.new
|
|
|
|
end
|
2019-06-12 21:58:27 -05:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2022-03-21 09:28:52 -05:00
|
|
|
Rails.application.config.to_prepare do
|
2021-03-19 14:51:13 -05:00
|
|
|
RailsMultisite::ConnectionManagement.safe_each_connection do
|
|
|
|
begin
|
|
|
|
SiteSetting.refresh!
|
2016-08-25 21:47:10 -05:00
|
|
|
|
2023-01-07 05:59:28 -06:00
|
|
|
unless String === SiteSetting.push_api_secret_key &&
|
|
|
|
SiteSetting.push_api_secret_key.length == 32
|
2021-03-19 14:51:13 -05:00
|
|
|
SiteSetting.push_api_secret_key = SecureRandom.hex
|
2016-08-25 21:47:10 -05:00
|
|
|
end
|
2021-03-19 14:51:13 -05:00
|
|
|
rescue ActiveRecord::StatementInvalid
|
|
|
|
# This will happen when migrating a new database
|
2014-04-02 18:39:30 -05:00
|
|
|
end
|
2021-03-19 14:51:13 -05:00
|
|
|
end
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|