From ff8c6c9dde3a877b51e2fabafa579e2c05dc856e Mon Sep 17 00:00:00 2001 From: unwox Date: Thu, 17 Oct 2024 10:32:35 +0600 Subject: implement caching --- bin/fetch.fnl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bin/fetch.fnl') 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) -- cgit v1.2.3