Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import javax.annotation.PostConstruct;

import io.mosip.kernel.core.exception.ExceptionUtils;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down Expand Up @@ -143,15 +144,15 @@ private static void loadPropertiesFromConfigServer() {
vertx.close();
startApplication();
} else {
LOGGER.warn(json.cause().getMessage() + "\n");
LOGGER.warn(json.cause().getMessage() + "\n" + ExceptionUtils.getStackTrace(json.cause()));
json.otherwiseEmpty();
retriever.close();
vertx.close();
startApplication();
}
});
} catch (Exception exception) {
LOGGER.warn(exception.getMessage() + "\n");
LOGGER.warn(exception.getMessage() + "\n" + ExceptionUtils.getStackTrace(exception));
vertx.close();
startApplication();
}
Expand All @@ -173,7 +174,7 @@ private static void startApplication() {
Verticle[] workerVerticles = { new VidPoolCheckerVerticle(context), new VidPopulatorVerticle(context),
new VidExpiryVerticle(context), new VidIsolatorVerticle(context) };
Stream.of(workerVerticles).forEach(verticle -> deploy(verticle, workerOptions, vertx));
vertx.setTimer(1000, handler -> initVIDPool());
vertx.setTimer(10000, handler -> initVIDPool());
Verticle[] uinVerticles = { new UinGeneratorVerticle(context),new UinTransferVerticle(context)};
Stream.of(uinVerticles).forEach(verticle -> vertx.deployVerticle(verticle, stringAsyncResult -> {
if (stringAsyncResult.succeeded()) {
Expand All @@ -183,7 +184,7 @@ private static void startApplication() {
+ stringAsyncResult.cause());
}
}));
vertx.setTimer(1000, handler -> initUINPool());
vertx.setTimer(10000, handler -> initUINPool());
}

@PostConstruct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private void getRouter(Vertx vertx, RoutingContext routingContext, boolean isSig
Router router, int workerExecutorPool) {
ResponseWrapper<UinResponseDto> reswrp = new ResponseWrapper<>();
String timestamp = DateUtils.getUTCCurrentDateTimeString();
WorkerExecutor executor = vertx.createSharedWorkerExecutor("get-uin", workerExecutorPool);
WorkerExecutor executor = vertx.createSharedWorkerExecutor("get-uin", workerExecutorPool, 1);
executor.executeBlocking(blockingCodeHandler -> {
try {
checkAndGenerateUins(vertx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public interface UinRepository extends JpaRepository<UinEntity, String> {
public void updateStatus(@Param("status") String status, @Param("contextUser") String contextUser,
@Param("uptimes") LocalDateTime uptimes, @Param("uin") String uin);

@Query(value = "select uu.uin, uu.cr_by, uu.cr_dtimes, uu.del_dtimes, uu.is_deleted, uu.upd_by, uu.upd_dtimes, uu.uin_status from kernel.uin uu where uu.uin_status=?", nativeQuery = true)
@Query(value = "select uu.uin, uu.cr_by, uu.cr_dtimes, uu.del_dtimes, uu.is_deleted, uu.upd_by, uu.upd_dtimes, uu.uin_status from kernel.uin uu where uu.uin_status=? LIMIT 100000", nativeQuery = true)
public List<UinEntity> findByStatus(String status);

long countByStatusAndIsDeletedFalse(String status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public UinStatusUpdateReponseDto updateUinStatus(UinEntity uinAck, RoutingContex
@Transactional(transactionManager = "transactionManager")
@Override
public void transferUin() {
List<UinEntity> uinEntities=uinRepository.findByStatus(UinGeneratorConstant.ASSIGNED);
List<UinEntity> uinEntities=uinRepository.findByStatus(UinGeneratorConstant.ISSUED);
List<UinEntityAssigned> uinEntitiesAssined = modelMapper.map(uinEntities, new TypeToken<List<UinEntityAssigned>>() {}.getType());
uinRepositoryAssigned.saveAll(uinEntitiesAssined);
uinRepository.deleteAll(uinEntities);
Expand Down