diff options
author | MichaelMorris <michael.morris@est.tech> | 2022-08-13 09:06:08 +0100 |
---|---|---|
committer | MichaelMorris <michael.morris@est.tech> | 2022-08-15 10:25:17 +0100 |
commit | cc764ab040ec1c278d8619d2d92be638d8f585e8 (patch) | |
tree | 23af29059bcc8f1e38ded05d02cf11cf8d99f5f0 /catalog-model | |
parent | 6bbf79ac50acb21e7e4ceb8c613eb4ecc872aa3d (diff) |
Fix new data types not found in UI
Also, fixed issue with data type sorting when there are mutliple layers in dependency hierarchy
Signed-off-by: MichaelMorris <michael.morris@est.tech>
Issue-ID: SDC-4129
Change-Id: I4d535420953237efd610a3fb1dd6b9d40883e514
Diffstat (limited to 'catalog-model')
-rw-r--r-- | catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/ApplicationDataTypeCache.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/ApplicationDataTypeCache.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/ApplicationDataTypeCache.java index 954df91552..0b4d02a0ab 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/ApplicationDataTypeCache.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/cache/ApplicationDataTypeCache.java @@ -206,13 +206,7 @@ public class ApplicationDataTypeCache implements ApplicationCache<DataTypeDefini @Override public void run() { try { - final long startTime = System.currentTimeMillis(); - log.trace("Starting refresh data types cache job"); - if (hasDataTypesChanged()) { - log.info("Detected changes in the data types, updating the data type cache."); - refreshDataTypesCache(); - } - log.trace("Finished refresh data types cache job. Finished in {}ms", (System.currentTimeMillis() - startTime)); + refreshDataTypesCacheIfStale(); } catch (final Exception e) { var errorMsg = "Failed to run refresh data types cache job"; log.error(EcompLoggerErrorCode.UNKNOWN_ERROR, ApplicationDataTypeCache.class.getName(), errorMsg, e); @@ -291,6 +285,16 @@ public class ApplicationDataTypeCache implements ApplicationCache<DataTypeDefini readWriteLock.readLock().unlock(); } } + + public void refreshDataTypesCacheIfStale() { + final long startTime = System.currentTimeMillis(); + log.trace("Starting refresh data types cache"); + if (hasDataTypesChanged()) { + log.info("Detected changes in the data types, updating the data type cache."); + refreshDataTypesCache(); + } + log.trace("Finished refresh data types cache. Finished in {}ms", (System.currentTimeMillis() - startTime)); + } private void refreshDataTypesCache() { final Map<String, Map<String, DataTypeDefinition>> dataTypesDefinitionMap = findAllDataTypesEager(); |