Skip to content

Commit e088830

Browse files
committed
DS-2259: Database - fix database settings initialization and increase statement timeout.
Signed-off-by: mchrza <maximilian.chrzan@here.com>
1 parent f6b3acb commit e088830

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • xyz-jobs/xyz-job-steps/src/main/java/com/here/xyz/jobs/steps/execution/db

xyz-jobs/xyz-job-steps/src/main/java/com/here/xyz/jobs/steps/execution/db/Database.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
import software.amazon.awssdk.services.rds.model.DBCluster;
5656

5757
public class Database extends ExecutionResource {
58-
private static final int STATEMENT_TIMEOUT = 895; //seconds - has to greater than the query timeouts
58+
private static final int STATEMENT_TIMEOUT = 895; //seconds - has to be greater than the query timeout
5959
private static final int DB_CHECKOUT_TIMEOUT_MS = 20_000;
6060
private static final int DB_ACQUIRE_RETRY_DELAY_MS = 5_000;
6161
private static final int DB_ACQUIRE_RETRY_ATTEMPTS = 10;
@@ -112,20 +112,20 @@ static void closeAll() {
112112

113113
DatabaseSettings getDatabaseSettings() {
114114
if (dbSettings == null)
115-
dbSettings = applyRuntimeDbSettings(new RestrictedDatabaseSettings(getName(), connectorDbSettingsMap)
116-
.withApplicationName("JobFramework"));
115+
dbSettings = applyRuntimeDbSettings(new RestrictedDatabaseSettings(getName(), connectorDbSettingsMap));
117116
return dbSettings;
118117
}
119118

120-
private static <T extends DatabaseSettings> T applyRuntimeDbSettings(T settings) {
119+
private static DatabaseSettings applyRuntimeDbSettings(DatabaseSettings settings) {
121120
settings
122121
.withStatementTimeoutSeconds(STATEMENT_TIMEOUT)
123122
.withDbCheckoutTimeout(DB_CHECKOUT_TIMEOUT_MS)
124123
.withDbAcquireRetryDelay(DB_ACQUIRE_RETRY_DELAY_MS)
125124
.withDbAcquireRetryAttempts(DB_ACQUIRE_RETRY_ATTEMPTS)
126125
.withDbAcquireIncrement(DB_ACQUIRE_INCREMENT)
127126
.withDbMaxPoolSize(DB_MAX_POOL_SIZE)
128-
.withScriptResourcePaths(SCRIPT_RESOURCE_PATHS);
127+
.withScriptResourcePaths(SCRIPT_RESOURCE_PATHS)
128+
.withApplicationName("JobFramework");
129129
return settings;
130130
}
131131

0 commit comments

Comments
 (0)