FIX: `next` vs `return` in maxmind task (#23196)

(and added the dependence on `environment` for trying the task independently of `assets:precompile`)
This commit is contained in:
Jarek Radosz 2023-08-22 23:00:02 +02:00 committed by GitHub
parent 68eba53e09
commit 9b63ac473b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -38,9 +38,9 @@ end
maxmind_thread = nil
task "maxminddb:refresh" do
task "maxminddb:refresh": "environment" do
refresh_days = GlobalSetting.refresh_maxmind_db_during_precompile_days
return if refresh_days.to_i <= 0
next if refresh_days.to_i <= 0
mmdb_time = get_mmdb_time(DiscourseIpInfo.path)
@ -54,7 +54,7 @@ task "maxminddb:refresh" do
mmdb_time = backup_mmdb_time
end
return if mmdb_time && mmdb_time >= refresh_days.days.ago
next if mmdb_time && mmdb_time >= refresh_days.days.ago
puts "Downloading MaxMindDB..."