summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-12-19 16:36:09 +0600
committerunwox <me@unwox.com>2024-12-19 16:44:54 +0600
commitc070964e142398f55c01c00b02f12015d886bd5c (patch)
treed85090f1887057682dd744dee1ecbae968664f05
parentbd40c328d08ec40c363029972837451b7993199f (diff)
small improvements
-rw-r--r--.nvim.lua7
-rw-r--r--bin/fetch.fnl11
-rw-r--r--texts.fnl2
3 files changed, 7 insertions, 13 deletions
diff --git a/.nvim.lua b/.nvim.lua
index 8da22e3..a0e5777 100644
--- a/.nvim.lua
+++ b/.nvim.lua
@@ -9,11 +9,8 @@ end)
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
pattern = {"*.fnl"},
callback = function()
- vim.repl.fennel.cmd = {"./run.sh", "serve", "--jit"}
+ vim.repl.fennel.cmd = {"go", "run", "-tags=fts5,jit", "../.",
+ "-n", "1", "-D", "main.lua", "bin/serve.fnl"}
vim.repl.fennel.filters = {}
- vim.opt.lispwords:append("local")
- vim.opt.lispwords:append("fn")
- vim.opt.lispwords:append("set")
- vim.opt.lispwords:append("if")
end,
})
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)
diff --git a/texts.fnl b/texts.fnl
index c21d1a2..3e6ebaa 100644
--- a/texts.fnl
+++ b/texts.fnl
@@ -11,7 +11,7 @@ everytea.ru соединяет продукцию нескольких мага
на&nbsp;каждый день? Или, может, подарок любителю
<a href=\"/?tags=Улун&price-per=on&min-price=50\">элитного улуна</a>?
<a href=\"/?tags=Посуда&query=чайник&sort=expensive-first\">Чайник за&nbsp;миллион</a>?
-<a href=\"/?tags=Посуда&query=жаба\">Жабу</a>🐸? Вероятно, в&nbsp;нашем
+<a href=\"/?tags=Посуда&query=жаба\">Жабу</a>&nbsp;🐸? Вероятно, в&nbsp;нашем
каталоге это&nbsp;найдется.
</p>