Skip to content

Commit

Permalink
HELLODATA-1881 - adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Slawomir Wieczorek committed Dec 12, 2024
1 parent 9ba9c7f commit a51980e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ public void processContextRoleUpdate(UserContextRoleUpdate userContextRoleUpdate
}

private User fetchUser(UserContextRoleUpdate userContextRoleUpdate) {
User user = null;
try {
return sftpgoService.getUser(userContextRoleUpdate.getUsername());
user = sftpgoService.getUser(userContextRoleUpdate.getUsername());
log.info("User {} already created", user);
} catch (WebClientResponseException.NotFound notFound) {
log.debug("", notFound);
return sftpgoService.createUser(userContextRoleUpdate.getEmail(), userContextRoleUpdate.getUsername(), UUID.randomUUID().toString());
user = sftpgoService.createUser(userContextRoleUpdate.getEmail(), userContextRoleUpdate.getUsername(), UUID.randomUUID().toString());
} catch (Exception e) {
log.error("Could not create user {}", userContextRoleUpdate.getEmail(), e);
}
return user;
}

}

0 comments on commit a51980e

Please sign in to comment.