DeActiveInstitutionEndOfContract hangfire completed
This commit is contained in:
@@ -75,16 +75,22 @@ public class JobSchedulerRegistrator
|
||||
|
||||
|
||||
|
||||
RecurringJob.AddOrUpdate(
|
||||
"InstitutionContract.Block",
|
||||
() => Block(),
|
||||
"*/30 * * * *" // هر 30 دقیقه یکبار چک کن
|
||||
);
|
||||
//RecurringJob.AddOrUpdate(
|
||||
// "InstitutionContract.Block",
|
||||
// () => Block(),
|
||||
// "*/30 * * * *" // هر 30 دقیقه یکبار چک کن
|
||||
//);
|
||||
|
||||
//RecurringJob.AddOrUpdate(
|
||||
// "InstitutionContract.UnBlock",
|
||||
// () => UnBlock(),
|
||||
// "*/10 * * * *"
|
||||
//);
|
||||
|
||||
RecurringJob.AddOrUpdate(
|
||||
"InstitutionContract.UnBlock",
|
||||
() => UnBlock(),
|
||||
"*/10 * * * *"
|
||||
"InstitutionContract.DeActiveInstitutionEndOfContract",
|
||||
() => DeActiveInstitutionEndOfContract(),
|
||||
"*/30 * * * *"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -220,30 +226,49 @@ public class JobSchedulerRegistrator
|
||||
/// <summary>
|
||||
/// بلاگ سازی
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
///// <returns></returns>
|
||||
//[DisableConcurrentExecution(timeoutInSeconds: 100)]
|
||||
//public async System.Threading.Tasks.Task Block()
|
||||
//{
|
||||
// _logger.LogInformation("block job run");
|
||||
// var now = DateTime.Now;
|
||||
// var executeDate = now.ToFarsi().Substring(8, 2);
|
||||
// if (executeDate == "20")
|
||||
// {
|
||||
// if (now.Hour >= 9 && now.Hour < 10)
|
||||
// {
|
||||
// await _institutionContractSmsServiceRepository.Block(now);
|
||||
// }
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
//[DisableConcurrentExecution(timeoutInSeconds: 100)]
|
||||
//public async System.Threading.Tasks.Task UnBlock()
|
||||
//{
|
||||
// _logger.LogInformation("UnBlock job run");
|
||||
|
||||
// await _institutionContractSmsServiceRepository.UnBlock();
|
||||
|
||||
//}
|
||||
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 100)]
|
||||
public async System.Threading.Tasks.Task Block()
|
||||
public async System.Threading.Tasks.Task DeActiveInstitutionEndOfContract()
|
||||
{
|
||||
_logger.LogInformation("block job run");
|
||||
_logger.LogInformation("DeActiveInstitutionEndOfContract job run");
|
||||
|
||||
|
||||
var now = DateTime.Now;
|
||||
var executeDate = now.ToFarsi().Substring(8, 2);
|
||||
if (executeDate == "20")
|
||||
if (executeDate == "01")
|
||||
{
|
||||
if (now.Hour >= 9 && now.Hour < 10)
|
||||
{
|
||||
await _institutionContractSmsServiceRepository.Block(now);
|
||||
await _institutionContractSmsServiceRepository.DeActiveInstitutionEndOfContract(now);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 100)]
|
||||
public async System.Threading.Tasks.Task UnBlock()
|
||||
{
|
||||
_logger.LogInformation("UnBlock job run");
|
||||
|
||||
await _institutionContractSmsServiceRepository.UnBlock();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user