Skip to content

Conversation

@maliming
Copy link
Member

Copy link
Contributor

Copilot AI left a 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 AbpHangfirePeriodicBackgroundWorkerAdapterOptions class to configure timezone and queue settings globally
  • Modified HangfirePeriodicBackgroundWorkerAdapter to accept options via constructor injection
  • Updated HangfireBackgroundWorkerManager to 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.

…kgroundWorkers/Hangfire/AbpHangfirePeriodicBackgroundWorkerAdapterOptions.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@maliming maliming requested a review from EngincanV January 19, 2026 08:10
@maliming maliming merged commit 22c1007 into rel-10.1 Jan 20, 2026
3 checks passed
@maliming maliming deleted the AbpHangfirePeriodicBackgroundWorkerAdapterOptions branch January 20, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants