Skip to content

Commit

Permalink
0005098: Auto sync triggers at startup and force parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Oct 6, 2021
1 parent cf48cef commit 7377407
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Expand Up @@ -608,9 +608,10 @@ public synchronized boolean start(boolean startJobs) {
"Starting registered node [group={}, id={}, nodeId={}]",
new Object[] { node.getNodeGroupId(), node.getNodeId(),
node.getExternalId() });
if (parameterService.is(ParameterConstants.AUTO_SYNC_TRIGGERS_AT_STARTUP,
true)) {
triggerRouterService.syncTriggers();
boolean force = parameterService.is(ParameterConstants.AUTO_SYNC_TRIGGERS_AT_STARTUP_FORCE);
if (parameterService.is(ParameterConstants.AUTO_SYNC_TRIGGERS_AT_STARTUP, true) || force ||
triggerRouterService.getActiveTriggerHistories().size() == 0) {
triggerRouterService.syncTriggers(force);
} else {
log.info(ParameterConstants.AUTO_SYNC_TRIGGERS_AT_STARTUP
+ " is turned off");
Expand Down
Expand Up @@ -124,6 +124,7 @@ private ParameterConstants() {
public final static String AUTO_CONFIGURE_DATABASE_FAST = "auto.config.database.fast";
public final static String AUTO_SYNC_TRIGGERS = "auto.sync.triggers";
public final static String AUTO_SYNC_TRIGGERS_AT_STARTUP = "auto.sync.triggers.at.startup";
public final static String AUTO_SYNC_TRIGGERS_AT_STARTUP_FORCE = "auto.sync.triggers.at.startup.force";
public final static String AUTO_SYNC_CONFIG_AT_STARTUP = "auto.sync.config.at.startup";
public final static String AUTO_SYNC_CONFIG_AFTER_UPGRADE = "auto.sync.config.after.upgrade";
public final static String AUTO_SYNC_TRIGGERS_AFTER_CONFIG_CHANGED = "auto.sync.triggers.after.config.change";
Expand Down
10 changes: 8 additions & 2 deletions symmetric-core/src/main/resources/symmetric-default.properties
Expand Up @@ -668,13 +668,19 @@ auto.sync.triggers.after.config.change=true
# Type: boolean
auto.sync.triggers.after.config.loaded=true


# If this is true, then run the sync triggers process at startup
#
# DatabaseOverridable: true
# Tags: general
# Type: boolean
auto.sync.triggers.at.startup=true
auto.sync.triggers.at.startup=false

# If this is true, then force rebuild of all triggers at startup
#
# DatabaseOverridable: true
# Tags: general
# Type: boolean
auto.sync.triggers.at.startup.force=false

# If this is true, then check if configuration should be pulled from registration server at startup.
# If the config version in the database does not match the software version, it will pull config.
Expand Down

0 comments on commit 7377407

Please sign in to comment.