bacgrountTask InstitutionContract some changes

This commit is contained in:
SamSys
2025-12-25 12:32:10 +03:30
parent ad4b0be033
commit d254da1393
3 changed files with 7 additions and 4 deletions

View File

@@ -70,7 +70,7 @@ public class JobSchedulerRegistrator
var now =DateTime.Now; var now =DateTime.Now;
var endOfMonth = now.ToFarsi().FindeEndOfMonth(); var endOfMonth = now.ToFarsi().FindeEndOfMonth();
var endOfMonthGr = endOfMonth.ToGeorgianDateTime(); var endOfMonthGr = endOfMonth.ToGeorgianDateTime();
_logger.LogInformation("CreateFinancialTransaction job run");
if (now.Date == endOfMonthGr.Date && now.Hour >= 2 && now.Hour < 4 && if (now.Date == endOfMonthGr.Date && now.Hour >= 2 && now.Hour < 4 &&
now.Date != _lastRunCreateTransaction?.Date) now.Date != _lastRunCreateTransaction?.Date)
{ {
@@ -115,7 +115,7 @@ public class JobSchedulerRegistrator
var now = DateTime.Now; var now = DateTime.Now;
var endOfMonth = now.ToFarsi().FindeEndOfMonth(); var endOfMonth = now.ToFarsi().FindeEndOfMonth();
var endOfMonthGr = endOfMonth.ToGeorgianDateTime(); var endOfMonthGr = endOfMonth.ToGeorgianDateTime();
_logger.LogInformation("SendFirstDayOfMonthSms job run");
if (now.Date == endOfMonthGr.Date && now.Hour >= 10 && now.Hour < 11 && if (now.Date == endOfMonthGr.Date && now.Hour >= 10 && now.Hour < 11 &&
now.Date != _lastRunSendMonthlySms?.Date) now.Date != _lastRunSendMonthlySms?.Date)
{ {
@@ -143,6 +143,7 @@ public class JobSchedulerRegistrator
[DisableConcurrentExecution(timeoutInSeconds: 1200)] [DisableConcurrentExecution(timeoutInSeconds: 1200)]
public async System.Threading.Tasks.Task SendReminderSms() public async System.Threading.Tasks.Task SendReminderSms()
{ {
_logger.LogInformation("SendReminderSms job run");
await _institutionContractRepository.SendReminderSmsForBackgroundTask(); await _institutionContractRepository.SendReminderSmsForBackgroundTask();
} }
@@ -153,6 +154,7 @@ public class JobSchedulerRegistrator
[DisableConcurrentExecution(timeoutInSeconds: 100)] [DisableConcurrentExecution(timeoutInSeconds: 100)]
public async System.Threading.Tasks.Task SendBlockSms() public async System.Threading.Tasks.Task SendBlockSms()
{ {
_logger.LogInformation("SendBlockSms job run");
await _institutionContractRepository.SendBlockSmsForBackgroundTask(); await _institutionContractRepository.SendBlockSmsForBackgroundTask();
} }
@@ -164,6 +166,7 @@ public class JobSchedulerRegistrator
[DisableConcurrentExecution(timeoutInSeconds: 100)] [DisableConcurrentExecution(timeoutInSeconds: 100)]
public async System.Threading.Tasks.Task SendInstitutionContractConfirmSms() public async System.Threading.Tasks.Task SendInstitutionContractConfirmSms()
{ {
_logger.LogInformation("SendInstitutionContractConfirmSms job run");
await _institutionContractRepository.SendInstitutionContractConfirmSmsTask(); await _institutionContractRepository.SendInstitutionContractConfirmSmsTask();
} }

View File

@@ -38,7 +38,7 @@ Log.Logger = new LoggerConfiguration()
//NO Microsoft Public log //NO Microsoft Public log
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning) .MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
//.MinimumLevel.Information()
.WriteTo.File( .WriteTo.File(
path: Path.Combine(logDirectory, "institution-contract-log-.txt"), path: Path.Combine(logDirectory, "institution-contract-log-.txt"),
rollingInterval: RollingInterval.Day, rollingInterval: RollingInterval.Day,

View File

@@ -3476,7 +3476,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
public async Task<bool> SendReminderSmsForBackgroundTask() public async Task<bool> SendReminderSmsForBackgroundTask()
{ {
var now = DateTime.Now; var now = DateTime.Now;
_logger.LogInformation("================>> SendReminderSmsForBackgroundTask job run");
// تبدیل تاریخ میلادی به شمسی // تبدیل تاریخ میلادی به شمسی
var persianNow = now.ToFarsi(); var persianNow = now.ToFarsi();