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){
|
if(aggregationStatus.getAggregationState()==null){
|
||||||
aggregationStatus.setState(AggregationState.STARTED, startTime, true);
|
aggregationStatus.setState(AggregationState.STARTED, startTime, true);
|
||||||
}
|
}else{
|
||||||
|
if(aggregationStatus.getAggregationState()==AggregationState.COMPLETED){
|
||||||
if(aggregationStatus.getAggregationState()==AggregationState.COMPLETED){
|
logger.info("{} is {}. Nothing to do :-). \n Details {}",
|
||||||
logger.info("{} is {}. Nothing to do :-). \n Details {}",
|
AggregationStatus.class.getSimpleName(),
|
||||||
AggregationStatus.class.getSimpleName(),
|
aggregationStatus.getAggregationState(),
|
||||||
aggregationStatus.getAggregationState(),
|
DSMapper.getObjectMapper().writeValueAsString(aggregationStatus));
|
||||||
DSMapper.getObjectMapper().writeValueAsString(aggregationStatus));
|
return;
|
||||||
return;
|
}else{
|
||||||
|
aggregationStatus.updateLastUpdateTime(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String recordType = aggregationInfo.getRecordType();
|
String recordType = aggregationInfo.getRecordType();
|
||||||
|
|
|
@ -158,4 +158,11 @@ public class AggregationStatus {
|
||||||
this.malformedRecordNumber = malformedRecordNumber;
|
this.malformedRecordNumber = malformedRecordNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateLastUpdateTime(boolean sync) throws Exception {
|
||||||
|
this.lastUpdateTime = Utility.getUTCCalendarInstance();
|
||||||
|
if(sync){
|
||||||
|
CouchBaseConnector.upsertAggregationStatus(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue