HangfireIO / Hangfire

An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
https://www.hangfire.io
Other
9.43k stars 1.7k forks source link

Unable to obtain http context #2441

Closed Brawns closed 2 months ago

Brawns commented 2 months ago

How to solve the problem that the scheduled task executed by Hangfire cannot obtain the http context of the original request, and some interfaces assigned according to the http context cannot obtain the value in the method executed by Hangfire

burningice2866 commented 2 months ago

Thats not something you can do. Ever.

Solution is to pass all required and necessary information needed to execute the job as parameters when you schedule it.