implement scan and index queue
This commit is contained in:
parent
118cfd91de
commit
e0314dcf56
4 changed files with 81 additions and 33 deletions
|
|
@ -166,7 +166,7 @@ func indexHandler(ctx *Context) {
|
|||
if fpath, ok = hasTrimPrefix(path, core.IndexPrefix); ok {
|
||||
log = log.WithValues("file", fpath)
|
||||
log.V(2).Info("started indexing file")
|
||||
err = scanFile(ctx.Srv, fpath)
|
||||
err = ctx.Srv.SQ.Add(fpath)
|
||||
if err != nil {
|
||||
log.Error(err, "error indexing file")
|
||||
}
|
||||
|
|
@ -214,7 +214,7 @@ func indexHandler(ctx *Context) {
|
|||
ctx.Srv.DB.IndexMutex.Set(uint64(len(files)))
|
||||
for _, f := range files {
|
||||
if !ctx.Srv.DB.IsIndexed(f) {
|
||||
err := scanFile(ctx.Srv, f)
|
||||
err := ctx.Srv.SQ.Add(f)
|
||||
if err != nil {
|
||||
log.Error(err, "error indexing file", "file", f)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue