Skip to content

Commit d144f57

Browse files
committed
[TINKERPOP-3146] Address PR comments
1 parent 129d1a4 commit d144f57

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public void init(final ServerGremlinExecutor serverGremlinExecutor) {
165165
logger.error("Failed to reload SSLFactory", e);
166166
}
167167
}),
168-
1L, 1L, TimeUnit.MINUTES
168+
settings.ssl.refreshInterval, settings.ssl.refreshInterval, TimeUnit.MILLISECONDS
169169
);
170170
}
171171
} else {

gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,12 @@ public static class SslSettings {
581581
*/
582582
public ClientAuth needClientAuth = ClientAuth.NONE;
583583

584+
/**
585+
* The interval, in milliseconds, at which the trustStore and keyStore files are checked for updates.
586+
* The default interval is 60 seconds.
587+
*/
588+
public long refreshInterval = 60000L;
589+
584590
private SslContext sslContext;
585591

586592
/**

gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/SSLStoreFilesModificationWatcher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class SSLStoreFilesModificationWatcher implements Runnable {
5353
* @param trustStore path to the trustStore file or null to ignore
5454
* @param onModificationRunnable function to run when a modification to the keyStore or trustStore is detected
5555
*/
56-
public SSLStoreFilesModificationWatcher(String keyStore, String trustStore, Runnable onModificationRunnable) {
56+
public SSLStoreFilesModificationWatcher(final String keyStore, final String trustStore, final Runnable onModificationRunnable) {
5757
// keyStore/trustStore can be null when not specified in gremlin-server Settings
5858
this.keyStore = keyStore != null ? Paths.get(keyStore) : null;
5959
this.trustStore = trustStore != null ? Paths.get(trustStore) : null;
@@ -117,8 +117,8 @@ public void run() {
117117
}
118118
}
119119

120-
private static ZonedDateTime getLastModifiedTime(Path filepath) throws IOException {
120+
private static ZonedDateTime getLastModifiedTime(final Path filepath) throws IOException {
121121
BasicFileAttributes attributes = Files.readAttributes(filepath, BasicFileAttributes.class);
122122
return ZonedDateTime.ofInstant(attributes.lastModifiedTime().toInstant(), ZoneOffset.UTC);
123123
}
124-
}
124+
}

0 commit comments

Comments
 (0)