Open josegar74 opened 3 years ago
+1 to use the last date from harvest-history, in that scenario we can also evaluate if the last run was successfull (display a warning icon on the list if it was not), but what happens if someone removes harvest history? Actually no problem, because one can imagine that the last-run-date is not available anymore then
Describe the bug When a harvester execution is finished, the
lastRun
field is stored in the harvester settings with the last execution date, but if the harvester information is updated, the field is cleaned as the harvester settings are recreated when the harvester is saved.To Reproduce Steps to reproduce the behavior:
Invalid date
, in the database the field no longer existsExpected behavior I'm not really sure the usage of this field, except for convenience? The harvester history table has the last execution also, maybe can be extracted from there (an issue can happen if the harvester history is cleaned).
Otherwise, maybe to review the current harvester save code to preserve the
lastRun
(and potentially other harvester settings) only set up when the harvester is executed.Screenshots After saving the harvester the last run field is cleaned, displaying a confusing information in the UI:
The issue is in this code that recreates the harverter settings when the harvester is saved:
https://github.com/geonetwork/core-geonetwork/blob/dd0ff029a1ae5d240d72dbe025fa7db453818491/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java#L967
The
lastRun
information is not currently part of theCswParams
used to update the harvester settings.Maybe, it can make sense to reset that value maybe if the url or the filters change. But it's a bit confusing to display Last run as
Invalid date
and below the number of records harvested.