Skip to content

Commit

Permalink
MODINV-986: post-rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PBobylev committed Jun 6, 2024
1 parent 740ccc4 commit e4dffe4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.apache.logging.log4j.Logger;
import org.folio.DataImportEventTypes;
import org.folio.inventory.consortium.cache.ConsortiumDataCache;
import org.folio.inventory.dataimport.cache.ProfileSnapshotCache;
import org.folio.inventory.dataimport.consumers.DataImportKafkaHandler;
import org.folio.inventory.dataimport.util.ConsumerWrapperUtil;
import org.folio.inventory.support.KafkaConsumerVerticle;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.folio.inventory.support;

import static java.lang.Integer.parseInt;
import static java.lang.Long.*;
import static java.lang.String.format;
import static java.lang.String.join;
import static java.lang.System.getProperty;
Expand Down Expand Up @@ -39,15 +38,13 @@ public abstract class KafkaConsumerVerticle extends AbstractVerticle {
private static final String MAX_DISTRIBUTION_NUMBER_TEMPLATE = "inventory.kafka.%s.maxDistributionNumber";
private static final String MAX_DISTRIBUTION_NUMBER_DEFAULT = "100";
private static final String CACHE_EXPIRATION_DEFAULT = "3600";
private static final String METADATA_EXPIRATION_TIME = "inventory.mapping-metadata-cache.expiration.time.seconds";
private static final String PROFILE_SNAPSHOT_CACHE_EXPIRATION_TIME = "inventory.profile-snapshot-cache.expiration.time.seconds";
private final List<KafkaConsumerWrapper<String, String>> consumerWrappers = new ArrayList<>();
private ProfileSnapshotCache profileSnapshotCache;
private KafkaConfig kafkaConfig;
private JsonObject config;
private HttpClient httpClient;
private Storage storage;
private MappingMetadataCache mappingMetadataCache;
private ProfileSnapshotCache profileSnapshotCache;

@Override
public void stop(Promise<Void> stopPromise) {
Expand Down Expand Up @@ -108,11 +105,7 @@ protected Storage getStorage() {
}

protected MappingMetadataCache getMappingMetadataCache() {
if (isNull(mappingMetadataCache)) {
var mappingMetadataExpirationTime = getCacheEnvVariable(METADATA_EXPIRATION_TIME);
mappingMetadataCache = new MappingMetadataCache(vertx, getHttpClient(), parseLong(mappingMetadataExpirationTime));
}
return mappingMetadataCache;
return MappingMetadataCache.getInstance(vertx, getHttpClient());
}

protected ProfileSnapshotCache getProfileSnapshotCache() {
Expand Down

0 comments on commit e4dffe4

Please sign in to comment.