|
1 | 1 | defmoduleGroupherServer.Applicationdo
|
| 2 | +@moduledocfalse |
2 | 3 | useApplication
|
3 | 4 |
|
4 | 5 | # See https://hexdocs.pm/elixir/Application.html
|
5 | 6 | # for more information on OTP Applications
|
6 | 7 | defstart(_type,_args)do
|
7 | 8 | importSupervisor.Spec
|
| 9 | +importCachex.Spec |
8 | 10 |
|
9 | 11 | # Define workers and child supervisors to be supervised
|
10 | 12 | children=[
|
11 | 13 | # Start the Ecto repository
|
12 | 14 | supervisor(GroupherServer.Repo,[]),
|
13 | 15 | # Start the endpoint when the application starts
|
14 |
| -supervisor(GroupherServerWeb.Endpoint,[]) |
| 16 | +supervisor(GroupherServerWeb.Endpoint,[]), |
15 | 17 | # Start your own worker by calling: GroupherServer.Worker.start_link(arg1, arg2, arg3)
|
16 | 18 | # worker(GroupherServer.Worker, [arg1, arg2, arg3]),
|
| 19 | +worker(Cachex,[ |
| 20 | +:site_cache, |
| 21 | +[ |
| 22 | +limit: |
| 23 | +limit( |
| 24 | +# the limit provided |
| 25 | +size:5000, |
| 26 | +# the policy to use for eviction |
| 27 | +policy:Cachex.Policy.LRW, |
| 28 | +# how much to reclaim on bound expiration |
| 29 | +reclaim:0.1, |
| 30 | +# options to pass to the policy |
| 31 | +options:[] |
| 32 | +) |
| 33 | +] |
| 34 | +]), |
| 35 | +{Rihanna.Supervisor,[postgrex:GroupherServer.Repo.config()]} |
17 | 36 | ]
|
18 | 37 |
|
19 | 38 | # See https://hexdocs.pm/elixir/Supervisor.html
|
|