懒得勤快 5 years ago
parent
commit
7acb9194d6
1 changed files with 2 additions and 4 deletions
  1. 2 4
      src/Masuit.MyBlogs.Core/Extensions/Hangfire/HangfireBackJob.cs

+ 2 - 4
src/Masuit.MyBlogs.Core/Extensions/Hangfire/HangfireBackJob.cs

@@ -1,5 +1,4 @@
-using IP2Region;
-using Masuit.LuceneEFCore.SearchEngine.Interfaces;
+using Masuit.LuceneEFCore.SearchEngine.Interfaces;
 using Masuit.MyBlogs.Core.Common;
 using Masuit.MyBlogs.Core.Infrastructure;
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
@@ -145,8 +144,7 @@ namespace Masuit.MyBlogs.Core.Extensions.Hangfire
             }
             else
             {
-                using var searcher = new DbSearcher(Path.Combine(AppContext.BaseDirectory + "App_Data", "ip2region.db"));
-                s.Address = searcher.MemorySearch(s.IP).Region;
+                s.Address = s.IP.GetIPLocation();
             }
             RedisHelper.LPush("intercept", s);
         }