AnderssonPeter / Hangfire.Console.Extensions

Makes it easier to use Hangfire.Console with .net core dependency injection
MIT License
79 stars 17 forks source link

PerformingContext null on first job run #3

Closed steve-gombos closed 3 years ago

steve-gombos commented 3 years ago

Using the Serilog package, there are some scenarios where the PerformingContext is returned as null when a job is first run, but then subsequent jobs log just fine. It seems like this is because the HangfireSubscriber filter is being added after job execution begins. Adding the HangfireSubscriber during ConfigureServices seems to resolve this issue. Not sure why this behavior is different from the MEL implementation, I'm assuming there is a difference between Serilog and MEL startup.

AnderssonPeter commented 3 years ago

What is MEL?

steve-gombos commented 3 years ago

Sorry, Microsoft.Extensions.Logging.

AnderssonPeter commented 3 years ago

New nuget uploaded with your changes. https://www.nuget.org/packages/Hangfire.Console.Extensions/1.0.4

steve-gombos commented 3 years ago

Thanks for the work you have done on this.

AnderssonPeter commented 3 years ago

No problem thanks for your contribution!