Skip to content

Commit

Permalink
Don't fail if es is not enabled and config is missing
Browse files Browse the repository at this point in the history
If es is not enabled, startup fails as values for the related vars
are still required.

Change-Id: I23cf5ce862bb503eb308bb7e6431fef51edda291
  • Loading branch information
bpedersen2 committed Dec 21, 2023
1 parent 35808f8 commit deb90cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/elastic-search/elastic-search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ export class ElasticSearchService implements OnModuleInit {
this.defaultIndex =
this.configService.get<string>("elasticSearch.defaultIndex") || "";

if (!this.host || !this.username || !this.password || !this.defaultIndex) {
if (
this.esEnabled &&
(!this.host || !this.username || !this.password || !this.defaultIndex)
) {
Logger.error(
"Missing ENVIRONMENT variables for elastic search connection",
);
Expand Down

0 comments on commit deb90cc

Please sign in to comment.