|
55 | 55 | import software.amazon.awssdk.services.rds.model.DBCluster; |
56 | 56 |
|
57 | 57 | 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 |
59 | 59 | private static final int DB_CHECKOUT_TIMEOUT_MS = 20_000; |
60 | 60 | private static final int DB_ACQUIRE_RETRY_DELAY_MS = 5_000; |
61 | 61 | private static final int DB_ACQUIRE_RETRY_ATTEMPTS = 10; |
@@ -112,20 +112,20 @@ static void closeAll() { |
112 | 112 |
|
113 | 113 | DatabaseSettings getDatabaseSettings() { |
114 | 114 | if (dbSettings == null) |
115 | | - dbSettings = applyRuntimeDbSettings(new RestrictedDatabaseSettings(getName(), connectorDbSettingsMap) |
116 | | - .withApplicationName("JobFramework")); |
| 115 | + dbSettings = applyRuntimeDbSettings(new RestrictedDatabaseSettings(getName(), connectorDbSettingsMap)); |
117 | 116 | return dbSettings; |
118 | 117 | } |
119 | 118 |
|
120 | | - private static <T extends DatabaseSettings> T applyRuntimeDbSettings(T settings) { |
| 119 | + private static DatabaseSettings applyRuntimeDbSettings(DatabaseSettings settings) { |
121 | 120 | settings |
122 | 121 | .withStatementTimeoutSeconds(STATEMENT_TIMEOUT) |
123 | 122 | .withDbCheckoutTimeout(DB_CHECKOUT_TIMEOUT_MS) |
124 | 123 | .withDbAcquireRetryDelay(DB_ACQUIRE_RETRY_DELAY_MS) |
125 | 124 | .withDbAcquireRetryAttempts(DB_ACQUIRE_RETRY_ATTEMPTS) |
126 | 125 | .withDbAcquireIncrement(DB_ACQUIRE_INCREMENT) |
127 | 126 | .withDbMaxPoolSize(DB_MAX_POOL_SIZE) |
128 | | - .withScriptResourcePaths(SCRIPT_RESOURCE_PATHS); |
| 127 | + .withScriptResourcePaths(SCRIPT_RESOURCE_PATHS) |
| 128 | + .withApplicationName("JobFramework"); |
129 | 129 | return settings; |
130 | 130 | } |
131 | 131 |
|
|
0 commit comments