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

+ 1 - 8
src/Masuit.MyBlogs.Core/Extensions/Hangfire/HangfireBackJob.cs

@@ -138,14 +138,7 @@ namespace Masuit.MyBlogs.Core.Extensions.Hangfire
         {
             RedisHelper.IncrBy("interceptCount");
             var result = s.IP.GetPhysicsAddressInfo().Result;
-            if (result?.Status == 0)
-            {
-                s.Address = result.AddressResult.FormattedAddress;
-            }
-            else
-            {
-                s.Address = s.IP.GetIPLocation();
-            }
+            s.Address = result?.Status == 0 ? result.AddressResult.FormattedAddress : s.IP.GetIPLocation();
             RedisHelper.LPush("intercept", s);
         }