Open SebaDro opened 3 years ago
Hi,
okay, for existing jobs the relevant dates are indeed not set, as they are set for its dataMap when the job is "registered" within the observer.
For existing jobs that have run at least one time, I was sure, that they should jump into the if part of the following SentinelJob.java code block. As they set the DateTime object under the very same dataMap key. Was your job already registered but without having run at least once?
Maybe it is also a problem that the former implmentation tried to register the DateTime object directly into job dataMap. Arne told me, that might lead to problems during persisting the information. That is why the current implementation writes DateTime object to String and then puts those into job dataMap.
// If there was a Job execution before, consider the latest request
// end date as start date for the current request.
// Else, use the factory level based generic configuration of the first
if (dataMap.get(LAST_LATEST_PRODUCT_KEY) != null) {
startDate = (DateTime) dataMap.get(LAST_LATEST_PRODUCT_KEY);
endDate = DateTime.now();
}
else {
startDate = DateTime.parse((String)dataMap.get(TemporalCoverageConstants.START_DATE));
endDate = DateTime.parse((String)dataMap.get(TemporalCoverageConstants.END_DATE));
}
dataMap.put(LAST_LATEST_PRODUCT_KEY, endDate);
I tried it with a fresh registration of the specifed job and that worked well, as the relevant parameters are initialized correctly. Would that be an option for the failing job as well? To save its definition, delete it and than reintegrate it as a new job?
Was your job already registered but without having run at least once?
Unfortunately, I'm not sure if the job has been executed at least once.
Maybe it is also a problem that the former implmentation tried to register the DateTime object directly into job dataMap. Arne told me, that might lead to problems during persisting the information. That is why the current implementation writes DateTime object to String and then puts those into job dataMap.
That should be the reason why parsing failed. However, should the LAST_LATEST_PRODUCT_KEY
DateTime object not be stored as String then, too?
I tried it with a fresh registration of the specifed job and that worked well, as the relevant parameters are initialized correctly. Would that be an option for the failing job as well? To save its definition, delete it and than reintegrate it as a new job?
Yes, I would be fine with it. I will recreate the concerning job within the Job Definition API.
yes, you are totally right. I simply used the previous lines of code, when I implemented the new date functionalities. I now ensured that dateTime objects are stored as string in commit c27b77ce6d66cd11eba70255a2f4bbae7f130f0c
The 2.1.0 release fails for parsing start and end date of existing periodic jobs:
The existing job for which the parsing failed should be available under the link below: https://job-definition.wacodis.52north.org/jobDefinitions/b7cbbdb3-46c4-4c6f-86cb-9d21c5531c6b