Skip to content

Commit

Permalink
fix failing spring init
Browse files Browse the repository at this point in the history
  • Loading branch information
andreybavt committed Nov 22, 2022
1 parent 3445c8a commit dbe295d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,11 @@ public class InitService {
private final GeneralSettingsService generalSettingsService;
private final ResourceLoader resourceLoader;
private final FileUploadService fileUploadService;
private final Map<String, ProjectConfig> projects = createProjectConfigMap();
private Map<String, ProjectConfig> projects;
String[] mockKeys = stream(AuthoritiesConstants.AUTHORITIES).map(key -> key.replace("ROLE_", "")).toArray(String[]::new);
private final Map<String, String> users = stream(mockKeys).collect(Collectors.toMap(String::toLowerCase, String::toLowerCase));

private Map<String, ProjectConfig> createProjectConfigMap() {

return Map.of(
ZILLOW_PROJECT_KEY, new ProjectConfig("House Pricing Regression", "aicreator",
ModelUploadParamsDTO.builder().modelType("regression")
Expand Down Expand Up @@ -251,6 +250,7 @@ public String getProjectByCreatorLogin(String login) {
@EventListener(ApplicationReadyEvent.class)
@Transactional
public void init() {
projects = createProjectConfigMap();
generalSettingsService.saveIfNotExists(new GeneralSettings());
initAuthorities();
initUsers();
Expand Down

0 comments on commit dbe295d

Please sign in to comment.