Ver Fonte

定时任务rank关键字bug修复

Murphy há 3 anos atrás
pai
commit
436549d5ab

+ 7 - 1
MicroServices/Business/Business.Host/Business.Host.csproj

@@ -10,7 +10,7 @@
 
   <ItemGroup>
     <PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
-    <PackageReference Include="Hangfire.MySql.Core-net5" Version="1.0.0" />
+    <PackageReference Include="HuffeyHangFire" Version="1.0.0" />
 	 <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.3" />
     <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.3" />
     <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.5">
@@ -41,4 +41,10 @@
     <Folder Include="wwwroot\" />
   </ItemGroup>
 
+  <ItemGroup>
+    <Reference Include="Hangfire.MySql.Core">
+      <HintPath>..\..\..\..\Hangfire.MySql.Core\Hangfire.MySql\bin\Debug\net5.0\Hangfire.MySql.Core.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+
 </Project>

+ 9 - 1
MicroServices/Business/Business.Host/BusinessHostModule.cs

@@ -110,7 +110,15 @@ namespace Business
                 //    TransactionTimeout = TimeSpan.FromMinutes(1),
                 //    TablePrefix = "Hangfire"
                 //}));
-                config.UseStorage(new MySqlStorage(configuration.GetConnectionString("Default")));
+                config.UseStorage(new MySqlStorage(configuration.GetConnectionString("Default"), new MySqlStorageOptions
+                {
+                    QueuePollInterval = TimeSpan.FromSeconds(15),
+                    JobExpirationCheckInterval = TimeSpan.FromHours(1),
+                    CountersAggregateInterval = TimeSpan.FromMinutes(5),
+                    PrepareSchemaIfNecessary = true,
+                    DashboardJobListLimit = 50000,
+                    TransactionTimeout = TimeSpan.FromMinutes(1),
+                }));
             });
         }