Skip to content

Commit

Permalink
fixed: set Hangfire JobStorage early to prevent errors when calling i…
Browse files Browse the repository at this point in the history
…t before its server starts, version bumped to 1.34.1
  • Loading branch information
martinzima committed Apr 4, 2023
1 parent fbc6467 commit e2cd704
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<VersionPrefix>1.34.0</VersionPrefix>
<VersionPrefix>1.34.1</VersionPrefix>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ public void ConfigureServices(IServiceCollection services)
{
var storage = hangfireConfigurationSection.JobStorage();

// this needs to be set here, otherwise Hangfire throws error when enqueuing a job
// before IGlobalConfiguration has been first requested by the DI container
GlobalConfiguration.Configuration.UseStorage(storage);

services
.AddHangfire(globalCfg =>
.AddHangfire(configuration =>
{
globalCfg.UseStorage(storage);
configuration.UseActivator(new HangfireJobActivator(kernel));
foreach (var action in hangfireConfigurationSection.ConfigurationActions)
{
action(globalCfg);
action(configuration);
}
globalCfg.UseNLogLogProvider();
globalCfg.UseActivator(new HangfireJobActivator(kernel));
});

if (hangfireConfigurationSection.AddHangfireServer)
Expand Down
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# RELEASE NOTES

## [1.34.1] - 2023-04-04

### Fixed
- set Hangfire JobStorage early to prevent errors when calling it before its server starts

## [1.34.0] - 2023-03-17

### Changed
Expand Down

0 comments on commit e2cd704

Please sign in to comment.