Skip to content

Commit

Permalink
sanity update (#193)
Browse files Browse the repository at this point in the history
Much of the harvest code depends on overly accessible data items. Added some sanity by making them final to ensure they do not get updated thus causing caching/index problems.

Co-authored-by: Al Niessner <[email protected]>
  • Loading branch information
al-niessner and Al Niessner authored Oct 8, 2024
1 parent e238dd4 commit 403c293
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/gov/nasa/pds/harvest/dao/RegistryManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public class RegistryManager

private RestClient client;

private RegistryDao registryDao;
private SchemaDao schemaDao;
private DataDictionaryDao ddDao;
final private RegistryDao registryDao;
final private SchemaDao schemaDao;
final private DataDictionaryDao ddDao;

private MetadataWriter registryWriter;
private CollectionInventoryWriter invWriter;

private FieldNameCache fieldNameCache;
final private FieldNameCache fieldNameCache;

private Counter counter;

Expand Down Expand Up @@ -76,9 +76,11 @@ private RegistryManager(ConnectionFactory conFact, boolean overwriteFlag) throws
* @param overwriteFlag overwrite registered products
* @throws Exception Generic exception
*/
public static void init(ConnectionFactory conFact, boolean overwriteFlag) throws Exception
public static synchronized void init(ConnectionFactory conFact, boolean overwriteFlag) throws Exception
{
if (instance == null) {
instance = new RegistryManager(conFact, overwriteFlag);
}
}


Expand Down

0 comments on commit 403c293

Please sign in to comment.