Skip to content

Commit

Permalink
Improve config name.
Browse files Browse the repository at this point in the history
  • Loading branch information
inthirakumaaran committed Dec 12, 2024
1 parent 95f71d6 commit 862f216
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private void handleTask(String tenantDomain) {
}

// Run the task only from master node in cluster setup.
if (isClusterModeEnabled() && !isHazelcastMasterNode()) {
if (isMasterNodeExclusiveExecutionEnabled() && !isHazelcastMasterNode()) {
return;
}

Expand Down Expand Up @@ -174,13 +174,13 @@ private void handleTask(String tenantDomain) {
}

/**
* Check whether suspension task runs in cluster or not.
* Check whether suspension task configured to run only in master node or not.
*
* @return true or false based on the deployment config.
*/
private boolean isClusterModeEnabled() {
private boolean isMasterNodeExclusiveExecutionEnabled() {

String clusterModeEnabledValue = IdentityUtil.getProperty(NotificationConstants.EXECUTE_TASK_IN_SINGLE_NODE);
String clusterModeEnabledValue = IdentityUtil.getProperty(NotificationConstants.EXECUTE_TASK_IN_MASTER_NODE);
return StringUtils.isNotBlank(clusterModeEnabledValue) ? Boolean.parseBoolean(clusterModeEnabledValue) : false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ protected void unsetRealmService(RealmService realmService) {
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetClusteringAgent")
protected void setClusteringAgent(ConfigurationContextService configurationContextService) {

NotificationTaskDataHolder.getInstance().setClusteringAgent(
configurationContextService.getServerConfigContext().getAxisConfiguration().getClusteringAgent());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class NotificationConstants {
public static final String SUSPENSION_NOTIFICATION_TRIGGER_TIME= "suspension.notification.trigger.time";
public static final String SUSPENSION_NOTIFICATION_DELAYS="suspension.notification.delays";
public static final String USE_IDENTITY_CLAIM_FOR_LAST_LOGIN_TIME = "AccountSuspension.UseIdentityClaims";
public static final String EXECUTE_TASK_IN_SINGLE_NODE = "AccountSuspension.ExecuteTaskOnSingleNode";
public static final String EXECUTE_TASK_IN_MASTER_NODE = "AccountSuspension.ExecuteTaskOnMasterNode";
public static final String TRIGGER_TIME_FORMAT = "HH:mm:ss";
public static final long SCHEDULER_DELAY = 24; // In hours
public static final String SUSPENSION_NOTIFICATION_THREAD_POOL_SIZE = "suspension.notification.thread.pool.size";
Expand Down

0 comments on commit 862f216

Please sign in to comment.