Caches configuration
This commit is contained in:
parent
f3afc6b700
commit
2f71aac235
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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()),
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -96,4 +96,7 @@ public class Caches extends BasicServiceTestUnit {
|
|||
if(executed.get()==launched.get()) service.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue