Compare commits

..

No commits in common. "5cc8a246da5cfb33a17c0aa8b8039cd372a2c32c" and "40f8887ef9fdbd23487c852d2248ea593500e3fa" have entirely different histories.

2 changed files with 1 additions and 17 deletions

View File

@ -41,21 +41,6 @@ public class HangfireHostService(IRecurringMessageScheduler _recurringMessageSch
HangfireJobHelper.RemoveCronJob(jobId); HangfireJobHelper.RemoveCronJob(jobId);
} }
// 清除所有可能存在的定时任务,防止类型加载错误
var allJobIdList = JobStorage.Current.GetConnection().GetRecurringJobs().Select(t => t.Id).ToList();
foreach (var jobId in allJobIdList)
{
try
{
HangfireJobHelper.RemoveCronJob(jobId);
_logger.LogInformation($"已清除定时任务: {jobId}");
}
catch (Exception ex)
{
_logger.LogWarning($"清除定时任务 {jobId} 时出错: {ex.Message}");
}
}
var taskInfoList = await _trialEmailNoticeConfigRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing && t.EmailCron != string.Empty && t.IsAutoSend) var taskInfoList = await _trialEmailNoticeConfigRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing && t.EmailCron != string.Empty && t.IsAutoSend)
.Select(t => new { t.Id, t.Code, TrialCode = t.Trial.TrialCode, t.EmailCron, t.BusinessScenarioEnum, t.TrialId }) .Select(t => new { t.Id, t.Code, TrialCode = t.Trial.TrialCode, t.EmailCron, t.BusinessScenarioEnum, t.TrialId })

View File

@ -27,8 +27,7 @@ namespace IRaCIS.Core.API
hangFireConfig.UseSqlServerStorage(hangFireConnStr, new SqlServerStorageOptions() hangFireConfig.UseSqlServerStorage(hangFireConnStr, new SqlServerStorageOptions()
{ {
SchemaName = "dbo", SchemaName = "dbo",
}).UseRecommendedSerializerSettings(); }).UseRecommendedSerializerSettings().UseSimpleAssemblyNameTypeSerializer();
// 移除 UseSimpleAssemblyNameTypeSerializer() 以避免类型加载问题
} }