From 77437fa03c88bb93001a841efbb82e50991d4964 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Thu, 5 Sep 2024 14:34:55 +0300 Subject: [PATCH] fixed sorting of jobs --- .../eu/dnetlib/repo/manager/service/MonitorServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/dnetlib/repo/manager/service/MonitorServiceImpl.java b/src/main/java/eu/dnetlib/repo/manager/service/MonitorServiceImpl.java index e5e9339..feb0f3e 100644 --- a/src/main/java/eu/dnetlib/repo/manager/service/MonitorServiceImpl.java +++ b/src/main/java/eu/dnetlib/repo/manager/service/MonitorServiceImpl.java @@ -124,6 +124,7 @@ public class MonitorServiceImpl implements MonitorService { if (retJobs.getJobs() != null) { jobs.addAll(retJobs.getJobs()); } + jobs.sort((s1, s2) -> s2.getStarted().compareTo(s1.getStarted())); // set all jobs back to retJobs retJobs.setJobs(jobs); } @@ -170,7 +171,7 @@ public class MonitorServiceImpl implements MonitorService { try { job = getValidationService().getStoredJob(Integer.parseInt(jobId), groupBy); } catch (Exception e) { - logger.error(e.getMessage(), e); + logger.warn("Job with id '{}' not found in Validator. Trying CRIS...", jobId, e); } ///////////////////////////////////////////////////////////////////////////////////////// // FIXME: this is a hack for CRIS Jan Dvorak Validator, should be implemented properly //