mirror of
https://github.com/google/nomulus.git
synced 2025-07-08 20:23:24 +02:00
Delay SQL availability check during Tool start (#643)
* Delay SQL availability check during Tool start During Cloud SQL migration, Cloud SQL password setup in Registry server requires a few tool commands. Such commands must be able to run before Cloud SQL is configured. In this change, we deplay SQL credential loading until access is needed.
This commit is contained in:
parent
75659671db
commit
071800ae50
4 changed files with 18 additions and 6 deletions
|
@ -21,6 +21,7 @@ import static org.testcontainers.containers.PostgreSQLContainer.POSTGRESQL_PORT;
|
|||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Suppliers;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
|
@ -199,12 +200,12 @@ abstract class JpaTransactionManagerRule extends ExternalResource {
|
|||
}
|
||||
JpaTransactionManagerImpl txnManager = new JpaTransactionManagerImpl(emf, clock);
|
||||
cachedTm = TransactionManagerFactory.jpaTm();
|
||||
TransactionManagerFactory.setJpaTm(txnManager);
|
||||
TransactionManagerFactory.setJpaTm(Suppliers.ofInstance(txnManager));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void after() {
|
||||
TransactionManagerFactory.setJpaTm(cachedTm);
|
||||
TransactionManagerFactory.setJpaTm(Suppliers.ofInstance(cachedTm));
|
||||
cachedTm = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue