-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add Hangfire periodic worker adapter options. #24669
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
Add Hangfire periodic worker adapter options. #24669
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request enhances the Hangfire background worker integration by introducing configurable options for the periodic background worker adapter. The changes enable dependency injection resolution of the adapter (replacing Activator.CreateInstance) and allow global configuration of timezone and queue settings through the new AbpHangfirePeriodicBackgroundWorkerAdapterOptions class.
Changes:
- Added
AbpHangfirePeriodicBackgroundWorkerAdapterOptionsclass to configure timezone and queue settings globally - Modified
HangfirePeriodicBackgroundWorkerAdapterto accept options via constructor injection - Updated
HangfireBackgroundWorkerManagerto resolve adapters via DI instead of reflection-based instantiation - Added demo application showcasing the new configuration pattern
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/AbpHangfirePeriodicBackgroundWorkerAdapterOptions.cs |
New options class for configuring timezone and queue defaults |
framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfirePeriodicBackgroundWorkerAdapter.cs |
Modified to accept IOptions<AbpHangfirePeriodicBackgroundWorkerAdapterOptions> via constructor and use collection expressions |
framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerManager.cs |
Updated to resolve adapter via DI, improved error logging, refactored variable naming, and code style improvements |
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/DemoAppHangfireModule.cs |
Added demonstration of new options configuration pattern with timezone and queue settings |
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/TestWorker.cs |
New test worker to demonstrate periodic background worker usage |
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj |
Added project references for background workers and SQL client |
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/Migrations/20260119064307_Initial.cs |
New EF Core migration with future timestamp (regenerated migration) |
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/Migrations/20260119064307_Initial.Designer.cs |
Migration designer file with future timestamp |
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/Migrations/DemoAppDbContextModelSnapshot.cs |
Updated model snapshot reflecting EF Core version upgrade |
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/Migrations/20201013055401_Initial.cs |
Removed old migration file |
Comments suppressed due to low confidence (1)
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/Migrations/20260119064307_Initial.Designer.cs:16
- The migration attribute references a timestamp from the future (20260119 = January 19, 2026). Migration timestamps should reflect the actual date when the migration was created. This should be updated to match the correct current date and also match the filename.
...ire/Volo/Abp/BackgroundWorkers/Hangfire/AbpHangfirePeriodicBackgroundWorkerAdapterOptions.cs
Outdated
Show resolved
Hide resolved
…kgroundWorkers/Hangfire/AbpHangfirePeriodicBackgroundWorkerAdapterOptions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ueProperty Handle Hangfire storage without JobQueueProperty feature.
#24666