chore
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Hangfire;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Atomx.Core.Jos
|
||||
{
|
||||
@@ -9,7 +7,7 @@ namespace Atomx.Core.Jos
|
||||
/// <summary>
|
||||
/// 多语言本地化任务
|
||||
/// </summary>
|
||||
public partial class LocalizationJob
|
||||
public class LocalizationJob
|
||||
{
|
||||
readonly ILogger<LocalizationJob> _logger;
|
||||
public LocalizationJob(ILogger<LocalizationJob> logger)
|
||||
@@ -17,10 +15,21 @@ namespace Atomx.Core.Jos
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
/// <summary>
|
||||
/// 如果任务失败,重试 3 次,超过后删除任务,60 秒内不允许并发执行
|
||||
/// </summary>
|
||||
[AutomaticRetry(Attempts = 3, OnAttemptsExceeded = AttemptsExceededAction.Delete)]
|
||||
[DisableConcurrentExecution(60)]
|
||||
public void Execute(string path)
|
||||
{
|
||||
_logger.LogInformation("LocalizationJob executed at: {time}", DateTimeOffset.Now);
|
||||
// 在这里添加多语言本地化的具体任务逻辑
|
||||
}
|
||||
|
||||
public void ResetCache()
|
||||
{
|
||||
_logger.LogInformation("LocalizationJob ResetCache executed at: {time}", DateTimeOffset.Now);
|
||||
// 在这里添加重置缓存的具体逻辑
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user