Use txt.conf to generate index.pck meta; fix double load while indexing

git-svn-id: file:///srv/svn/repo/kosuzu/trunk@22 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
fox
2022-11-02 21:47:20 +00:00
parent a89196679a
commit 4c7ed95a32
3 changed files with 16 additions and 13 deletions

View File

@@ -1,5 +1,4 @@
let targets () =
let kv = Logarion.File_store.of_kv_file () in
let targets kv =
let pub_dir =
try Logarion.Store.KV.find "Pubdir" kv with Not_found ->
try Sys.getenv "txtpubdir" with Not_found -> ""
@@ -13,8 +12,9 @@ let targets () =
open Logarion
let publish ids =
let kv = Logarion.File_store.of_kv_file () in
let predicate t = List.mem t.Text.id ids in
let targets = targets () in
let targets = targets kv in
let pub_dirs = List.map (fun x -> snd x) targets in
File_store.iter ~predicate (fun (_t, p) ->
try File.file ((List.hd p)::pub_dirs)