HangfireIO / HangfireIO/Hangfire

DI Scope of server filters

Open
#1,409 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

We are trying to retrofit a large application to support multi tenancy. Using a few posts here and from around the web I have created a JobFilter that pushes the current tenant ID into the job param list.

My hope was I could extract this from the job param list during the OnPerforming stage in the filter then push an object holding the value into my IoC container (autofac). It appears however the filter and the job do not live in the same scope.

Is there any way around this? Can I somehow push data from the job filter onto the job execution thread?

Thanks.

Contributor guide

Open the contributing guide

Research direction

Start with the JobFilter and its OnPerforming stage, then trace how the filter and job obtain their Autofac scopes during job execution. Determine whether tenant data can be transferred onto the job execution thread and shared with the job. Done means there is a documented, supported answer or an agreed implementation path for sharing this context.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.