Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

refs #154 Moved Mix.env to config #159

Merged
merged 1 commit into from
Mar 10, 2019
Merged

Conversation

Balt87
Copy link
Contributor

@Balt87 Balt87 commented Feb 18, 2019

No description provided.

Copy link
Member

@jamonholmgren jamonholmgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question in comment.

@@ -37,7 +37,7 @@ defmodule Thesis.Notifications do
"other" => []
}
|> notifications_from_host_app(conn, notifications())
|> notifications_regarding_env(Mix.env)
|> notifications_regarding_env(Application.get_env(:thesis, :env))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we fall back to Mix.env if this doesn't exist? For backwards compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! According to this topic: https://elixirforum.com/t/mix-env-in-production-no-longer-produces-nil-but-crashes-mix-state-genserver/16165/6
we shouldn't user Mix in production environment and since version 1.7.2 Mix is not included in compiled application.
And if we haven't this variable in config file Application.get_env just returns nil:
https://hexdocs.pm/elixir/Application.html#get_env/3
So we shouldn't fallback to Mix.env
P.S. before 1.7.2 Mix.env returns nil in production :)

@jamonholmgren jamonholmgren merged commit 2b99fc5 into infinitered:master Mar 10, 2019
@jamonholmgren
Copy link
Member

Thanks @Balt87 ! I'll release a new version to Hex soon!

@jamonholmgren
Copy link
Member

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants