Skip to content

Commit

Permalink
Merge pull request #1364 from ashitsalesforce/master
Browse files Browse the repository at this point in the history
make process.statusOutputDirectory property writable
  • Loading branch information
ashitsalesforce authored Oct 27, 2024
2 parents 70267ea + 4a70a32 commit 983f0ef
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/main/java/com/salesforce/dataloader/config/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,6 @@ public class AppConfig {
PROP_ENCRYPTION_KEY_FILE,
PROP_LAST_RUN_OUTPUT_DIR,
PROP_PROCESS_NAME,
PROP_OUTPUT_STATUS_DIR,
PROP_BULK_API_CHECK_STATUS_INTERVAL,
PROP_CONNECTION_TIMEOUT_SECS,
PROP_ENABLE_RETRIES,
Expand Down Expand Up @@ -1321,11 +1320,12 @@ public void putValues(Map<String, String> values) throws ParameterLoadException,
* @throws java.io.IOException if there is a problem saving this store
*/
public void save() throws IOException, GeneralSecurityException {
// lastrun properties are always saved
lastRunProperties.save();

if (getString(AppConfig.CLI_OPTION_RUN_MODE).equalsIgnoreCase(AppConfig.RUN_MODE_BATCH_VAL)
|| getBoolean(PROP_READ_ONLY_CONFIG_PROPERTIES)
|| !inMemoryPropValuesHaveChanged) {
// lastrun properties are always saved
lastRunProperties.save();
return; // do not save any updates to config.properties file
}
if (filename == null) {
Expand Down Expand Up @@ -1359,8 +1359,6 @@ public void save() throws IOException, GeneralSecurityException {
// restore original in-memory property values
loadedProperties = inMemoryProperties;
}
// save last run statistics
lastRunProperties.save();
}

public void setAuthEndpointForCurrentEnv(String authEndpoint) {
Expand Down Expand Up @@ -1653,20 +1651,18 @@ private void doSetPropertyAndUpdateConfig(String name, String oldValue, String n
} else {
loadedProperties.put(name, newValue);
}
if (isReadOnlyProperty(name)
|| isOverrideProperty(name)
|| isInternalProperty(name)
|| skipIfAlreadySet
|| lastRunProperties.hasParameter(name)) {
if (!isReadOnlyProperty(name)
&& !isOverrideProperty(name)
&& !isInternalProperty(name)
&& !skipIfAlreadySet
&& !lastRunProperties.hasParameter(name)) {
//read-only properties, internal properties,
// or properties overridden by setting them in process-conf.xml
// or passing them as command line options should not result in updates
// to config.properties file.
//
// Also, if skipIfAlreadySet==true, the property was not set
// in config.properties file. It is being set to its default value.
this.inMemoryPropValuesHaveChanged = false;
} else {
this.inMemoryPropValuesHaveChanged = true;
}
}
Expand Down

0 comments on commit 983f0ef

Please sign in to comment.