feat: 支持自动刷新价值调整
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Volo.Abp.BackgroundWorkers.Hangfire;
|
||||
using Yi.Framework.DigitalCollectibles.Domain.Managers;
|
||||
|
||||
namespace Yi.Framework.DigitalCollectibles.Application.Jobs;
|
||||
|
||||
/// <summary>
|
||||
/// 自动更新藏品价值
|
||||
/// </summary>
|
||||
public class AutoUpdateCollectiblesValueJob : HangfireBackgroundWorkerBase
|
||||
{
|
||||
private readonly CollectiblesManager _collectiblesManager;
|
||||
|
||||
public AutoUpdateCollectiblesValueJob(CollectiblesManager collectiblesManager)
|
||||
{
|
||||
_collectiblesManager = collectiblesManager;
|
||||
RecurringJobId = "更新藏品价值";
|
||||
//每天早上9点执行一次
|
||||
CronExpression = "0 0 9 * * ?";
|
||||
}
|
||||
|
||||
public override async Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||
{
|
||||
await _collectiblesManager.UpdateAllValueAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user