Updating LastUpdateTime before starting to execute any kind of operation when the AggregationStatus were already created on db
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-aggregator-se-plugin@154349 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f531cd4e8c
commit
6a9c463ac9
|
@ -103,14 +103,16 @@ public class Elaborator {
|
|||
|
||||
if(aggregationStatus.getAggregationState()==null){
|
||||
aggregationStatus.setState(AggregationState.STARTED, startTime, true);
|
||||
}
|
||||
|
||||
if(aggregationStatus.getAggregationState()==AggregationState.COMPLETED){
|
||||
logger.info("{} is {}. Nothing to do :-). \n Details {}",
|
||||
AggregationStatus.class.getSimpleName(),
|
||||
aggregationStatus.getAggregationState(),
|
||||
DSMapper.getObjectMapper().writeValueAsString(aggregationStatus));
|
||||
return;
|
||||
}else{
|
||||
if(aggregationStatus.getAggregationState()==AggregationState.COMPLETED){
|
||||
logger.info("{} is {}. Nothing to do :-). \n Details {}",
|
||||
AggregationStatus.class.getSimpleName(),
|
||||
aggregationStatus.getAggregationState(),
|
||||
DSMapper.getObjectMapper().writeValueAsString(aggregationStatus));
|
||||
return;
|
||||
}else{
|
||||
aggregationStatus.updateLastUpdateTime(true);
|
||||
}
|
||||
}
|
||||
|
||||
String recordType = aggregationInfo.getRecordType();
|
||||
|
|
|
@ -158,4 +158,11 @@ public class AggregationStatus {
|
|||
this.malformedRecordNumber = malformedRecordNumber;
|
||||
}
|
||||
|
||||
public void updateLastUpdateTime(boolean sync) throws Exception {
|
||||
this.lastUpdateTime = Utility.getUTCCalendarInstance();
|
||||
if(sync){
|
||||
CouchBaseConnector.upsertAggregationStatus(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue