diff options
| author | unwox <me@unwox.com> | 2024-12-19 16:36:09 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2024-12-19 16:44:54 +0600 |
| commit | c070964e142398f55c01c00b02f12015d886bd5c (patch) | |
| tree | d85090f1887057682dd744dee1ecbae968664f05 /bin/fetch.fnl | |
| parent | bd40c328d08ec40c363029972837451b7993199f (diff) | |
small improvements
Diffstat (limited to 'bin/fetch.fnl')
| -rw-r--r-- | bin/fetch.fnl | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/bin/fetch.fnl b/bin/fetch.fnl index a5f8d63..c23019f 100644 --- a/bin/fetch.fnl +++ b/bin/fetch.fnl @@ -143,13 +143,11 @@ AND creation_time < ?" [site creation-time]))))) -(fn populate-search-table [] - (local tx (must (luna.db.begin db))) +(fn populate-search-table [tx] (must (luna.db.exec-tx tx "DELETE FROM search" [])) (must (luna.db.exec-tx tx "INSERT INTO search - SELECT title, url, 'products' - FROM products;" [])) - (must (luna.db.commit tx))) + SELECT title, url, 'products' + FROM products;" []))) ;; replace with with-tx (local tx (must (luna.db.begin db))) @@ -158,6 +156,5 @@ gorkovchay])] (store-products tx (parser.products))) (cache.clear-tx tx "page:") +(populate-search-table tx) (must (luna.db.commit tx)) - -(populate-search-table) |
