* Fixed New Task creation
* Change Scheduler view
This commit is contained in:
@@ -88,21 +88,24 @@ public class HangfireJobsController(JobStorage jobStorage, IRecurringJobManager
|
||||
{
|
||||
var tasks = await service.GetTaskSchedulers();
|
||||
|
||||
// foreach (TaskSchedulerDto taskSchedulerDto in tasks)
|
||||
// {
|
||||
// taskSchedulerDto.JobDetails = GetJob(taskSchedulerDto.Name);
|
||||
// }
|
||||
foreach (TaskSchedulerDto taskSchedulerDto in tasks)
|
||||
{
|
||||
var job = GetJob(taskSchedulerDto.Name);
|
||||
taskSchedulerDto.LastExecution = job?.LastExecution;
|
||||
taskSchedulerDto.NextExecution = job?.NextExecution;
|
||||
}
|
||||
|
||||
return Ok(tasks);
|
||||
}
|
||||
|
||||
private JobData? GetJob(string jobId)
|
||||
private RecurringJobDto? GetJob(string jobId)
|
||||
{
|
||||
using IStorageConnection? connection = jobStorage.GetConnection();
|
||||
return connection.GetJobData(jobId);
|
||||
IList<RecurringJobDto>? recurringJobs = connection.GetRecurringJobs();
|
||||
return recurringJobs.FirstOrDefault(x => x.Id == jobId);
|
||||
}
|
||||
|
||||
private void RunConsoleApplication(string pathToApp)
|
||||
public void RunConsoleApplication(string pathToApp)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ public class ScheduleJobService(IEmailService emailService, IServiceScopeFactory
|
||||
using var scope = scopeFactory.CreateScope();
|
||||
IEdiCustomerOrderService ediCustomerOrderService = scope.ServiceProvider.GetRequiredService<IEdiCustomerOrderService>();
|
||||
IEnumerable<EdiCustomerOrderTranslateDto> missingOrders =
|
||||
(await ediCustomerOrderService.FindMissingOrders(new DateTime(2025, 2, 5))).ToList();
|
||||
(await ediCustomerOrderService.FindMissingOrders(DateTime.Now.AddDays(-1))).ToList();
|
||||
|
||||
if (missingOrders.Any())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user