Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to obtain http context #2442

Open
Brawns opened this issue Sep 9, 2024 · 1 comment
Open

Unable to obtain http context #2442

Brawns opened this issue Sep 9, 2024 · 1 comment

Comments

@Brawns
Copy link

Brawns commented Sep 9, 2024

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

@BredStik
Copy link

You should capture the values you need from the HttpContext in an object and use it as a parameter when scheduling the Hangfire task. HttpContext is never accessible outside of the original request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants