Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/MODINVSTOR-1154' into MODINVSTOR…
Browse files Browse the repository at this point in the history
…-1154
  • Loading branch information
azizbekxm committed Jan 24, 2024
2 parents e4755f7 + 286f2d7 commit 8713d9d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Remove extra fields from 'holdings/move' mechanism [MODINV-948](https://issues.folio.org/browse/MODINV-948)
* Allow to link local instance to shared instance [MODINV-901](https://issues.folio.org/browse/MODINV-901)
* OOM issue in mod-inventory ([MODINV-944](https://issues.folio.org/browse/MODINV-944))
* Make configurable params for instance sharing [MODINV-950](https://issues.folio.org/browse/MODINV-950)

## 20.1.0 2023-10-13
* Update status when user attempts to update shared auth record from member tenant ([MODDATAIMP-926](https://issues.folio.org/browse/MODDATAIMP-926))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.apache.logging.log4j.Logger;
import org.folio.Record;
import org.folio.inventory.consortium.entities.SharingInstance;
import org.folio.kafka.SimpleConfigurationReader;
import org.folio.rest.client.ChangeManagerClient;
import org.folio.rest.jaxrs.model.InitJobExecutionsRqDto;
import org.folio.rest.jaxrs.model.InitialRecord;
Expand Down Expand Up @@ -46,10 +47,23 @@ public class RestDataImportHelper {
public static final String STATUS_COMMITTED = "COMMITTED";
public static final String STATUS_ERROR = "ERROR";

private static final String IMPORT_STATUS_POLL_INTERVAL_SEC_PARAM =
"inventory.sharing.di.status.poll.interval.seconds";
private static final String IMPORT_STATUS_POLL_NUMBER_PARAM =
"inventory.sharing.di.status.poll.number";
private static final String DEFAULT_IMPORT_STATUS_POLL_INTERVAL_SEC = "5";
private static final String DEFAULT_IMPORT_STATUS_POLL_NUMBER = "5";

private final Vertx vertx;
private final long durationInSec;
private final int attemptsNumber;

public RestDataImportHelper(Vertx vertx) {
this.vertx = vertx;
this.durationInSec = Integer.parseInt(SimpleConfigurationReader.getValue(
IMPORT_STATUS_POLL_INTERVAL_SEC_PARAM, DEFAULT_IMPORT_STATUS_POLL_INTERVAL_SEC));
this.attemptsNumber = Integer.parseInt(SimpleConfigurationReader.getValue(
IMPORT_STATUS_POLL_NUMBER_PARAM, DEFAULT_IMPORT_STATUS_POLL_NUMBER));
}

public static final JobProfileInfo JOB_PROFILE_INFO = new JobProfileInfo()
Expand All @@ -73,11 +87,6 @@ public Future<String> importMarcRecord(Record marcRecord, SharingInstance sharin

ChangeManagerClient changeManagerClient = getChangeManagerClient(kafkaHeaders);

//TODO: move to config
//Constants for checkDataImportStatus method
final long durationInSec = 20;
final int attemptsNumber = 3;

return initJobExecution(instanceId, changeManagerClient, kafkaHeaders)
.compose(jobExecutionId -> setDefaultJobProfileToJobExecution(jobExecutionId, changeManagerClient))
.compose(jobExecutionId -> {
Expand Down

0 comments on commit 8713d9d

Please sign in to comment.