fix #5194 - improve performance of retrieving scheduled job logs
This commit is contained in:
@ -172,8 +172,7 @@ namespace Oqtane.Infrastructure
|
||||
jobs.UpdateJob(job);
|
||||
|
||||
// trim the job log
|
||||
List<JobLog> logs = jobLogs.GetJobLogs().Where(item => item.JobId == job.JobId)
|
||||
.OrderByDescending(item => item.JobLogId).ToList();
|
||||
List<JobLog> logs = jobLogs.GetJobLogs(job.JobId).ToList();
|
||||
for (int i = logs.Count; i > job.RetentionHistory; i--)
|
||||
{
|
||||
jobLogs.DeleteJobLog(logs[i - 1].JobLogId);
|
||||
|
Reference in New Issue
Block a user