-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[elixir] Version and code updates (#9198)
* Updates for Phoenix, Elixir, Erlang, and Docker image * Missed on mix file and template should be heex * Add back fortunes with heex * Update plug libraries * Code based performance improvements
- Loading branch information
1 parent
037639e
commit 1b2f23a
Showing
17 changed files
with
123 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
defmodule Hello.WorldCache do | ||
use Nebulex.Cache, | ||
otp_app: :hello, | ||
adapter: Nebulex.Adapters.Local | ||
|
||
alias Hello.Models.World | ||
alias Hello.Repo | ||
|
||
def seed do | ||
if not __MODULE__.has_key?(:seeded) do | ||
World | ||
|> Repo.all() | ||
|> Enum.into([], &{&1.id, &1}) | ||
|> __MODULE__.put_all() | ||
|
||
__MODULE__.put(:seeded, true) | ||
end | ||
end | ||
|
||
def fetch(id) do | ||
case __MODULE__.get(id) do | ||
nil -> | ||
world = Repo.get(World, id) | ||
:ok = __MODULE__.put(id, world) | ||
world | ||
world -> | ||
world | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.