Skip to content

Commit

Permalink
PIN-4916: new polling in import (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterITA authored Jul 2, 2024
1 parent c01ec7b commit ba9e866
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,10 @@ final case class EServicesApiServiceImpl(
deleteTempDirectory(folderPath)
catalogProcessService.deleteEService(eService.id).flatMap(_ => Future.failed(ex))
}
.flatMap(_ => pollEServiceById(catalogProcessService.getEServiceById(eService.id), _.riskAnalysis.nonEmpty))
}
descriptorSeed = CatalogProcess.EServiceDescriptorSeed(
description = importedEservice.descriptor.description,
audience = importedEservice.descriptor.audience,
voucherLifespan = importedEservice.descriptor.voucherLifespan,
dailyCallsPerConsumer = importedEservice.descriptor.dailyCallsPerConsumer,
Expand All @@ -1211,15 +1213,16 @@ final case class EServicesApiServiceImpl(
deleteTempDirectory(folderPath)
catalogProcessService.deleteEService(eService.id).flatMap(_ => Future.failed(ex))
}
_ <- pollEServiceById(
catalogProcessService.getEServiceById(eService.id),
eService => eService.descriptors.nonEmpty
)
_ <- pollEServiceById(catalogProcessService.getEServiceById(eService.id), _.descriptors.nonEmpty)
_ <- importedEservice.descriptor.interface match {
case Some(interface) =>
verifyAndCreateImportedDoc(eService, descriptor, folderPath, interface, "INTERFACE")
case None => Future.unit
}
_ <- pollEServiceById(
catalogProcessService.getEServiceById(eService.id),
_.descriptors.exists(d => d.id == descriptor.id && d.interface.isDefined)
)
_ <- importedEservice.descriptor.docs
.traverse(verifyAndCreateImportedDoc(eService, descriptor, folderPath, _, "DOCUMENT"))
_ = deleteTempDirectory(folderPath)
Expand Down

0 comments on commit ba9e866

Please sign in to comment.