* 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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user