diff --git a/src/main/java/org/gcube/dataharvest/AccountingDataHarvesterPlugin.java b/src/main/java/org/gcube/dataharvest/AccountingDataHarvesterPlugin.java index 0c8749e..68f0f37 100644 --- a/src/main/java/org/gcube/dataharvest/AccountingDataHarvesterPlugin.java +++ b/src/main/java/org/gcube/dataharvest/AccountingDataHarvesterPlugin.java @@ -9,6 +9,7 @@ import java.util.Map; import java.util.Properties; import java.util.SortedSet; +import org.gcube.common.authorization.library.provider.SecurityTokenProvider; import org.gcube.dataharvest.dao.DatabaseManager; import org.gcube.dataharvest.datamodel.HarvestedData; import org.gcube.dataharvest.harvester.MethodInvocationHarvester; @@ -133,6 +134,9 @@ public class AccountingDataHarvesterPlugin extends Plugin data = new ArrayList(); + + String initialToken = SecurityTokenProvider.instance.get(); + for(String context : contexts) { // Setting the token for the context @@ -149,9 +153,11 @@ public class AccountingDataHarvesterPlugin extends Plugin harvested = vreUsersHarvester.getData(); - data.addAll(harvested); + if(!reRun) { + VREUsersHarvester vreUsersHarvester = new VREUsersHarvester(start, end); + List harvested = vreUsersHarvester.getData(); + data.addAll(harvested); + } } catch(Exception e) { logger.error("Error harvesting Context Users for {}", context, e); } @@ -200,6 +206,8 @@ public class AccountingDataHarvesterPlugin extends Plugin