diff options
| author | Fuwn <[email protected]> | 2025-07-01 10:46:10 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-07-01 10:46:10 +0000 |
| commit | 397f7ea9a5e980d83dc26f256696580873211d8c (patch) | |
| tree | 157be9643023a1adc63afef5555ff5305bdd9e71 /src/mayu.gleam | |
| parent | style(image): Clearer version data representation (diff) | |
| download | mayu-397f7ea9a5e980d83dc26f256696580873211d8c.tar.xz mayu-397f7ea9a5e980d83dc26f256696580873211d8c.zip | |
feat: Pre-cache themes in memory
Diffstat (limited to 'src/mayu.gleam')
| -rw-r--r-- | src/mayu.gleam | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mayu.gleam b/src/mayu.gleam index 95442e8..2c3d78e 100644 --- a/src/mayu.gleam +++ b/src/mayu.gleam @@ -1,3 +1,4 @@ +import cache import database import gleam/erlang/process import mist @@ -10,6 +11,7 @@ pub fn main() { wisp.configure_logger() let _ = simplifile.create_directory("./data") + let image_cache = cache.load_themes() use connection <- sqlight.with_connection("./data/count.db") @@ -18,7 +20,7 @@ pub fn main() { let secret_key_base = wisp.random_string(64) let assert Ok(_) = wisp.mist_handler( - fn(request) { request.handle(request, connection) }, + fn(request) { request.handle(request, connection, image_cache) }, secret_key_base, ) |> mist.new |