mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 03:32:06 +00:00
Scale the tablebase cache to ~100k entries (#24)
* Slim the cached tablebase value to the fields the trainer reads (#20) * Sample for LFU eviction instead of scanning the cache (#21) * Make cache size configurable and back up daily off-peak (#22) * Document the cache design in the glossary and an ADR (#23) * Address cache-scaling code review findings
This commit is contained in:
@@ -7,6 +7,8 @@ defmodule Chesstrainer.Application do
|
||||
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
cache_opts = Application.get_env(:chesstrainer, Chesstrainer.Cache, [])
|
||||
|
||||
children = [
|
||||
ChesstrainerWeb.Telemetry,
|
||||
Chesstrainer.Repo,
|
||||
@@ -17,7 +19,8 @@ defmodule Chesstrainer.Application do
|
||||
# Start to serve requests, typically the last entry
|
||||
ChesstrainerWeb.Endpoint,
|
||||
{Registry, keys: :unique, name: Chesstrainer.CacheRegistry},
|
||||
{Chesstrainer.Cache, :tablebase}
|
||||
{Task.Supervisor, name: Chesstrainer.Cache.BackupSupervisor},
|
||||
{Chesstrainer.Cache, {:tablebase, cache_opts}}
|
||||
]
|
||||
|
||||
# See https://elixir.hexdocs.pm/Supervisor.html
|
||||
|
||||
Reference in New Issue
Block a user