compile tags regex once

This commit is contained in:
ston1th 2019-08-24 20:29:43 +02:00
commit 7686dfa474
5 changed files with 27 additions and 10 deletions

View file

@ -187,11 +187,11 @@ func scanFile(ctx *Context, path string) (err error) {
l.Printf("scanner: %s: %s", path, err)
return
}
t, err := ctx.Srv.DB.GetAllTags()
rt, err := ctx.Srv.DB.GetAllRTags()
if err != nil {
l.Printf("getTags: %s: %s", path, err)
}
found := tags.Find(txt, t)
found := tags.Find(txt, rt)
id, err := ctx.Srv.DB.Index.Add(txt, found)
if err != nil {
l.Printf("index: %s: %s", path, err)