Browse Source

Merge pull request #22717 from abpframework/auto-merge/rel-9-1/3669

Merge branch rel-9.2 with rel-9.1
pull/22718/head
maliming 1 year ago
committed by GitHub
parent
commit
2df5754d33
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 18
      docs/en/framework/infrastructure/background-jobs/hangfire.md
  2. 18
      docs/en/framework/infrastructure/background-workers/hangfire.md

18
docs/en/framework/infrastructure/background-jobs/hangfire.md

@ -84,6 +84,24 @@ After you have installed these NuGet packages, you need to configure your projec
}
````
### AbpHangfireOptions
You can configure the [BackgroundJobServerOptions](https://api.hangfire.io/html/T_Hangfire_BackgroundJobServerOptions.htm) of `AbpHangfireOptions` to customize the server.
````csharp
Configure<AbpHangfireOptions>(options =>
{
// If no ServerOptions is set, ABP will use the default BackgroundJobServerOptions instance.
options.ServerOptions = new BackgroundJobServerOptions
{
Queues = ["default", "alpha"],
//... other properties
};
});
````
> You don't need to call `AddHangfireServer` method, ABP will use AbpHangfireOptions's `ServerOptions` to create a server.
### Specifying Queue
You can use the [`QueueAttribute`](https://docs.hangfire.io/en/latest/background-processing/configuring-queues.html) to specify the queue:

18
docs/en/framework/infrastructure/background-workers/hangfire.md

@ -84,6 +84,24 @@ After you have installed these NuGet packages, you need to configure your projec
}
````
### AbpHangfireOptions
You can configure the [BackgroundJobServerOptions](https://api.hangfire.io/html/T_Hangfire_BackgroundJobServerOptions.htm) of `AbpHangfireOptions` to customize the server.
````csharp
Configure<AbpHangfireOptions>(options =>
{
// If no ServerOptions is set, ABP will use the default BackgroundJobServerOptions instance.
options.ServerOptions = new BackgroundJobServerOptions
{
Queues = ["default", "alpha"],
//... other properties
};
});
````
> You don't need to call `AddHangfireServer` method, ABP will use AbpHangfireOptions's `ServerOptions` to create a server.
## Create a Background Worker
`HangfireBackgroundWorkerBase` is an easy way to create a background worker.

Loading…
Cancel
Save