Last active
July 11, 2020 15:40
-
-
Save sskset/955b0892f48a57cd8bd6ff24ac585acb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
// Add Hangfire services. | |
services.AddHangfire(configuration => configuration | |
.SetDataCompatibilityLevel(CompatibilityLevel.Version_170) | |
.UseSimpleAssemblyNameTypeSerializer() | |
.UseRecommendedSerializerSettings() | |
.UseSqlServerStorage(Configuration.GetConnectionString("Hangfire"), new SqlServerStorageOptions | |
{ | |
CommandBatchMaxTimeout = TimeSpan.FromMinutes(5), | |
SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5), | |
QueuePollInterval = TimeSpan.Zero, | |
UseRecommendedIsolationLevel = true, | |
DisableGlobalLocks = true | |
})); | |
// Add the processing server as IHostedService | |
services.AddHangfireServer(); | |
services.AddControllers(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment