Caches configuration

This commit is contained in:
Fabio Sinibaldi 2021-10-06 16:12:16 +02:00
parent f3afc6b700
commit 2f71aac235
4 changed files with 9 additions and 4 deletions

View File

@ -38,6 +38,9 @@ public abstract class MongoManager {
log.info("Got Mongo Client at "+client.getConnectPoint());
log.debug("Mongo client is "+client);
// NOT AUTHORIZED
// log.debug("Existing databases "+client.getDatabaseNames());
}

View File

@ -31,14 +31,13 @@ public class MongoClientProvider extends AbstractScopedMap<MongoClient>{
MongoCredential credential = MongoCredential.createCredential(conn.getUser(), conn.getDatabase(),
conn.getPassword().toCharArray());
MongoClientOptions options = MongoClientOptions.builder().
threadsAllowedToBlockForConnectionMultiplier(10).
connectionsPerHost(20).
maxConnectionIdleTime(10000).
applicationName("geoportal-service").
sslEnabled(true).
connectTimeout(30000).
build();
return new MongoClient(new ServerAddress(conn.getHosts().get(0),conn.getPort()),

View File

@ -25,7 +25,7 @@ public class StorageClientProvider extends AbstractScopedMap<StorageUtils> {
public StorageClientProvider() {
super("Storage client cache");
setTTL(Duration.of(10, ChronoUnit.MINUTES));
// setTTL(Duration.of(10, ChronoUnit.MINUTES));
}
@Override
@ -37,7 +37,7 @@ public class StorageClientProvider extends AbstractScopedMap<StorageUtils> {
@Override
protected void dispose(StorageUtils toDispose) {
try {
//TODO
toDispose.forceClose();
}catch (NullPointerException e) {
// expected if closed without uploading
}catch(Throwable t) {

View File

@ -96,4 +96,7 @@ public class Caches extends BasicServiceTestUnit {
if(executed.get()==launched.get()) service.shutdown();
}
}
}