Skip to content

Commit

Permalink
Add logs for ProfileImportService
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanChernetskyi committed Aug 16, 2024
1 parent 82a3d25 commit 583b788
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ public ProfileImportServiceImpl(@Autowired ProfileSnapshotService profileSnapsho
@Override
public Future<ProfileSnapshotWrapper> importProfile(ProfileSnapshotWrapper profileSnapshot, String tenantId, OkapiConnectionParams okapiParams) {
if (profileSnapshot.getContentType() != JOB_PROFILE) {
return Future.failedFuture(new BadRequestException(String.format(PROFILE_SNAPSHOT_INVALID_TYPE,
profileSnapshot.getContentType(), JOB_PROFILE)));
String errorMessage = String.format(PROFILE_SNAPSHOT_INVALID_TYPE, profileSnapshot.getContentType(), JOB_PROFILE);
LOGGER.warn("importProfile:: {}", errorMessage);
return Future.failedFuture(new BadRequestException(errorMessage));
}
LOGGER.info("importProfile:: Started import for Job Profile with id {}", profileSnapshot.getProfileId());

convertProfileSnapshotWrapperContent(profileSnapshot);

Expand Down Expand Up @@ -152,6 +154,7 @@ private <T, S, D> Future<T> saveProfile(OkapiConnectionParams okapiParams, D pro
return profileService.getProfileById(profileId, false, okapiParams.getTenantId())
.compose(optionalProfile -> {
if (optionalProfile.isPresent()) {
LOGGER.debug("saveProfile:: Overlay profile with id {} during import", profileId);
return profileService.updateProfile(profileUpdateDto, okapiParams);
}
return profileService.saveProfile(profileUpdateDto, okapiParams);
Expand Down

0 comments on commit 583b788

Please sign in to comment.