Resolving #695:Fix for Policy Delegation task is not starting for tenants in distributed setup

revert-70aa11f8
Harshan Liyanage 8 years ago committed by amalhub
parent 0eeef0a568
commit 273be79ca2

@ -144,6 +144,8 @@ public class PolicyAdministratorPointImpl implements PolicyAdministratorPoint {
//Check whether the TaskType is already registered. If not we'll register it here.
if (!registeredTaskTypes.contains(PolicyManagementConstants.DELEGATION_TASK_TYPE)) {
taskService.registerTaskType(PolicyManagementConstants.DELEGATION_TASK_TYPE);
}
TaskInfo registeredTaskInfo = null;
// getTask method will throw a TaskException if the task is not registered. Hence we'll handle the
// exception and register the task.
@ -158,8 +160,6 @@ public class PolicyAdministratorPointImpl implements PolicyAdministratorPoint {
properties, triggerInfo);
taskManager.registerTask(taskInfo);
taskManager.scheduleTask(taskInfo.getName());
}
}
} else {
if (!taskManager.isTaskScheduled(taskName)) {
TaskInfo taskInfo = new TaskInfo(taskName, PolicyManagementConstants.DELEGATION_TASK_CLAZZ,
@ -171,6 +171,8 @@ public class PolicyAdministratorPointImpl implements PolicyAdministratorPoint {
"changes after few minutes.");
}
}
}
} catch (TaskException e) {
String msg = "Error occurred while creating the policy delegation task for tenant " +
PrivilegedCarbonContext.

Loading…
Cancel
Save