view src/lib/Db.luan @ 12:3e2cb946d511

form handling
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 30 Oct 2023 14:59:45 -0600
parents 43814e9f5802
children af2b95854072
line wrap: on
line source

local Luan = require "luan:Luan.luan"
local error = Luan.error
local new_error = Luan.new_error or error()
local Lucene = require "luan:lucene/Lucene.luan"
local Io = require "luan:Io.luan"
local uri = Io.uri or error()
local Http = require "luan:http/Http.luan"
local Thread = require "luan:Thread.luan"
local Time = require "luan:Time.luan"
local Logging = require "luan:logging/Logging.luan"
local logger = Logging.logger "Db"


local dir = uri("site:/private/local/lucene")

local Db = Lucene.index( dir, {
	log_dir = uri("site:/private/local/lucene_log")
	name = "lucene"
} )

function Db.not_in_transaction()
	logger.error(new_error("not in transaction"))
end

if Http.is_serving then
	Thread.schedule( Db.check, { delay=0, repeating_delay=Time.period{hours=1} } )
end

return Db