Browse Source
Update Background-Workers-Hangfire.md
pull/14895/head
maliming
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
2 deletions
-
docs/zh-Hans/Background-Workers-Hangfire.md
|
|
|
@ -78,7 +78,6 @@ public class MyLogWorker : HangfireBackgroundWorkerBase, IMyLogWorker |
|
|
|
CronExpression = Cron.Daily(); |
|
|
|
} |
|
|
|
|
|
|
|
[UnitOfWork] |
|
|
|
public override Task DoWorkAsync(CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
using (var uow = LazyServiceProvider.LazyGetRequiredService<IUnitOfWorkManager>().Begin()) |
|
|
|
@ -120,4 +119,4 @@ context.ServiceProvider |
|
|
|
|
|
|
|
它解析给定的后台工作者并添加到 `IBackgroundWorkerManager`. |
|
|
|
|
|
|
|
虽然我们通常在 `OnApplicationInitializationAsync` 中添加后台工作者, 但对此没有限制. 你可以在任何地方注入 `IBackgroundWorkerManager` 并在运行时添加后台工作者. |
|
|
|
虽然我们通常在 `OnApplicationInitializationAsync` 中添加后台工作者, 但对此没有限制. 你可以在任何地方注入 `IBackgroundWorkerManager` 并在运行时添加后台工作者. |
|
|
|
|