diff options
| author | unwox <me@unwox.com> | 2024-10-17 10:32:35 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2024-10-17 10:53:30 +0600 |
| commit | ff8c6c9dde3a877b51e2fabafa579e2c05dc856e (patch) | |
| tree | 3b6c9d8638ee78f913540e25ac7fc17433b906b6 /bin/fetch.fnl | |
| parent | 43c7b5de358e8a158e9ed3c396d3866845682515 (diff) | |
implement caching
Diffstat (limited to 'bin/fetch.fnl')
| -rw-r--r-- | bin/fetch.fnl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/fetch.fnl b/bin/fetch.fnl index 3ef57df..da5383d 100644 --- a/bin/fetch.fnl +++ b/bin/fetch.fnl @@ -5,6 +5,7 @@ (local fennel (require :vendor.fennel)) (local array (require :lib.array)) +(local cache (require :lib.cache)) (local ozchai (require :parser.ozchai)) (local ipuer (require :parser.ipuer)) (local artoftea (require :parser.artoftea)) @@ -45,6 +46,11 @@ CREATE TABLE IF NOT EXISTS tags( title TEXT NOT NULL PRIMARY KEY, creation_time DATETIME NOT NULL + ); + + CREATE TABLE IF NOT EXISTS cache( + key TEXT NOT NULL PRIMARY KEY, + value TEXT );" [])) (fn now [] @@ -138,6 +144,7 @@ ipuer.products ozchai.products])] (store-products tx (products))) +(cache.clear-tx tx) (must (luna.db.commit tx)) (populate-search-table) |
