mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 09:53:44 +08:00
0330f51d75
`DiscourseIpInfo` expects zeitwerk auto-loading to be available, so we need to ensure the rake task loads the full rails environment. Normally we run this task as part of assets:precompile, so the app is already initialized. This commit only affects the case where the maxmind task is run directly.
11 lines
323 B
Ruby
11 lines
323 B
Ruby
# frozen_string_literal: true
|
|
|
|
desc "downloads MaxMind's GeoLite2-City database"
|
|
task "maxminddb:get" => "environment" do
|
|
puts "Downloading MaxMindDb's GeoLite2-City..."
|
|
DiscourseIpInfo.mmdb_download("GeoLite2-City")
|
|
|
|
puts "Downloading MaxMindDb's GeoLite2-ASN..."
|
|
DiscourseIpInfo.mmdb_download("GeoLite2-ASN")
|
|
end
|