mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Resolving #695:Fix for Policy Delegation task is not starting for tenants in distributed setup
This commit is contained in:
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…
Reference in New Issue
Block a user