chore: update sitemap default host to use ENV variable
- Change default_host assignment to use ENV.fetch for RAILS_SITEMAP_DEFAULT_HOST - This allows for easier configuration based on the environment, particularly useful for production and development setups.
This commit is contained in:
parent
df86a10f03
commit
81116a2f3e
@ -4,7 +4,7 @@ class RefreshSitemapWorker
|
||||
def perform
|
||||
host = Rails.env.production? ? "https://todayaiweather.com" : "http://127.0.0.1:3000"
|
||||
Rails.application.routes.default_url_options[:host] = host
|
||||
SitemapGenerator::Sitemap.default_host = "https://pub.r2.todayaiweather.com"
|
||||
SitemapGenerator::Sitemap.default_host = ENV.fetch("RAILS_SITEMAP_DEFAULT_HOST", host)
|
||||
if Rails.env.production?
|
||||
SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSdkAdapter.new(
|
||||
ENV.fetch("AWS_BUCKET", Rails.application.credentials.dig(:aws, :bucket)),
|
||||
|
Loading…
Reference in New Issue
Block a user