Add a event provider which hold the repository events which are provided

by the ui.

fix the performance issue. Issue was the selection of targets. The table
needs very long to calculate the scroll position.

Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
SirWayne
2016-03-24 12:00:07 +01:00
parent 84519b77ab
commit 7e75b79cbe
7 changed files with 124 additions and 126 deletions

View File

@@ -8,8 +8,6 @@
*/
package org.eclipse.hawkbit.repository;
import java.util.List;
import org.eclipse.hawkbit.security.SystemSecurityContext;
import org.eclipse.hawkbit.tenancy.TenantAware;
import org.slf4j.Logger;
@@ -56,25 +54,25 @@ public class RolloutScheduler {
*/
@Scheduled(initialDelayString = RolloutProperties.Scheduler.PROP_SCHEDULER_DELAY_PLACEHOLDER, fixedDelayString = RolloutProperties.Scheduler.PROP_SCHEDULER_DELAY_PLACEHOLDER)
public void rolloutScheduler() {
logger.debug("rollout schedule checker has been triggered.");
// run this code in system code privileged to have the necessary
// permission to query and create entities.
systemSecurityContext.runAsSystem(() -> {
// workaround eclipselink that is currently not possible to
// execute a query without multitenancy if MultiTenant
// annotation is used.
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=355458. So
// iterate through all tenants and execute the rollout check for
// each tenant seperately.
final List<String> tenants = systemManagement.findTenants();
logger.info("Checking rollouts for {} tenants", tenants.size());
for (final String tenant : tenants) {
tenantAware.runAsTenant(tenant, () -> {
rolloutManagement.checkRunningRollouts(rolloutProperties.getScheduler().getFixedDelay());
return null;
});
}
return null;
});
// logger.debug("rollout schedule checker has been triggered.");
// // run this code in system code privileged to have the necessary
// // permission to query and create entities.
// systemSecurityContext.runAsSystem(() -> {
// // workaround eclipselink that is currently not possible to
// // execute a query without multitenancy if MultiTenant
// // annotation is used.
// // https://bugs.eclipse.org/bugs/show_bug.cgi?id=355458. So
// // iterate through all tenants and execute the rollout check for
// // each tenant seperately.
// final List<String> tenants = systemManagement.findTenants();
// logger.info("Checking rollouts for {} tenants", tenants.size());
// for (final String tenant : tenants) {
// tenantAware.runAsTenant(tenant, () -> {
// rolloutManagement.checkRunningRollouts(rolloutProperties.getScheduler().getFixedDelay());
// return null;
// });
// }
// return null;
// });
}
}