Skip to content

Commit

Permalink
Upgrade to Hangfire 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
nul800sebastiaan committed Aug 21, 2023
1 parent 6f02241 commit a0921cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cultiv.Hangfire/Cultiv.Hangfire.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Hangfire" Version="1.7.31" />
<PackageReference Include="Hangfire" Version="1.8.5" />
<PackageReference Include="Hangfire.Console" Version="1.4.2" />
<PackageReference Include="Umbraco.Cms.Core" Version="10.0.0" />
<PackageReference Include="Umbraco.Cms.Persistence.SqlServer" Version="10.0.0" />
Expand Down
6 changes: 4 additions & 2 deletions Cultiv.Hangfire/HangfireComposer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class HangfireComposer : IComposer
public void Compose(IUmbracoBuilder builder)
{
builder.ManifestFilters().Append<ManifestFilter>();

var connectionString = builder.GetConnectionString();
if (string.IsNullOrEmpty(connectionString))
{
Expand All @@ -35,7 +35,7 @@ public void Compose(IUmbracoBuilder builder)
builder.Services.AddHangfire(configuration =>
{
configuration
.SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
.SetDataCompatibilityLevel(CompatibilityLevel.Version_180)
.UseColouredConsoleLogProvider()
.UseDashboardMetric(SqlServerStorage.ActiveConnections)
.UseDashboardMetric(SqlServerStorage.TotalConnections)
Expand All @@ -46,6 +46,8 @@ public void Compose(IUmbracoBuilder builder)
.UseConsole()
.UseSqlServerStorage((Func<SqlConnection>)ConnectionFactory, new SqlServerStorageOptions
{
PrepareSchemaIfNecessary = true,
EnableHeavyMigrations = true,
CommandBatchMaxTimeout = TimeSpan.FromMinutes(5),
SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5),
QueuePollInterval = TimeSpan.Zero,
Expand Down

0 comments on commit a0921cc

Please sign in to comment.