FIX: Fix assets:precompile rake task.

FIX: Fix assets:precompile rake task.

diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake
index 09511f4..c389ea2 100644
--- a/lib/tasks/assets.rake
+++ b/lib/tasks/assets.rake
@@ -164,11 +164,10 @@ def concurrent?
 end
 
 task 'assets:precompile' => 'assets:precompile:before' do
-  path = DiscourseIpInfo.mmdb_path('GeoLite2-City')
-  mtime = File.exist?(path) && File.mtime(path)
-
   if refresh_days = SiteSetting.refresh_maxmind_db_during_precompile_days
-    if !mtime || mtime < refresh_days.days.ago
+    mmdb_path = DiscourseIpInfo.mmdb_path('GeoLite2-City')
+    mmdb_time = File.exist?(mmdb_path) && File.mtime(mmdb_path)
+    if !mmdb_time || mmdb_time < refresh_days.days.ago
       puts "Downloading MaxMindDB..."
       mmdb_thread = Thread.new do
         DiscourseIpInfo.mmdb_download('GeoLite2-City')

GitHub sha: c523a121