Skip to content

Commit 0458213

Browse files
committed
Increase delay in test ident retrieval and enhance resource creation logic
1 parent 66ba93c commit 0458213

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/nom/NomClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public Mono<BestillingProgress> gjenopprett(RsDollyUtvidetBestilling bestilling,
5656
} else if (isNull(ressurs.getSluttDato()) && nonNull(bestilling.getNomdata().getSluttDato())) {
5757
return nomConsumer.avsluttRessurs(dollyPerson.getIdent(),
5858
bestilling.getNomdata().getSluttDato().toLocalDate());
59+
} else if (nonNull(ressurs.getSluttDato()) && ressurs.getSluttDato().isBefore(LocalDate.now())) {
60+
return mapTilNomRequest(bestilling.getNomdata(), dollyPerson)
61+
.flatMap(nomConsumer::opprettRessurs);
5962
} else {
6063
return Mono.just(ressurs);
6164
}

apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/service/GjenopprettGruppeService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
import no.nav.dolly.repository.TestgruppeRepository;
1919
import no.nav.dolly.service.BestillingService;
2020
import no.nav.dolly.service.IdentService;
21-
import no.nav.dolly.util.ClearCacheUtil;
2221
import no.nav.dolly.service.TransactionHelperService;
22+
import no.nav.dolly.util.ClearCacheUtil;
2323
import org.springframework.cache.CacheManager;
2424
import org.springframework.scheduling.annotation.Async;
2525
import org.springframework.stereotype.Service;
2626
import reactor.core.publisher.Flux;
2727
import reactor.core.publisher.Mono;
28-
import reactor.core.scheduler.Schedulers;
2928
import reactor.util.function.Tuple2;
3029

3130
import java.time.Duration;
@@ -91,7 +90,7 @@ public void executeAsync(Bestilling bestilling) {
9190

9291
var counterIdentBestilling = new HashMap<String, Boolean>();
9392
identService.getTestidenterByGruppeId(bestilling.getGruppeId())
94-
.delayElements(Duration.ofMillis(1500))
93+
.delayElements(Duration.ofMillis(2000))
9594
.flatMap(testident -> bestillingService.isStoppet(bestilling.getId())
9695
.zipWith(Mono.just(testident)))
9796
.takeWhile(tuple -> isFalse(tuple.getT1()))

apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/service/OpprettPersonerFraIdenterMedKriterierService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public void executeAsync(Bestilling bestilling) {
8585
if (nonNull(bestKriterier)) {
8686

8787
availCheckService.checkAvailable(bestilling.getOpprettFraIdenter())
88-
.flatMap(progress -> bestillingService.isStoppet(bestilling.getId())
89-
.zipWith(Mono.just(progress)))
88+
.flatMap(avail -> bestillingService.isStoppet(bestilling.getId())
89+
.zipWith(Mono.just(avail)))
9090
.takeWhile(tuple -> isFalse(tuple.getT1()))
9191
.map(Tuple2::getT2)
9292
.filter(AvailCheckService.AvailStatus::isAvailable)

0 commit comments

Comments
 (0)