changed indexing buffer to save to ram not to file

This commit is contained in:
partisan 2025-01-02 12:55:44 +01:00
parent 918e1823df
commit 61266c461a
4 changed files with 155 additions and 62 deletions

13
init.go
View file

@ -3,8 +3,6 @@ package main
import (
"flag"
"os"
"path/filepath"
"time"
)
var config Config
@ -109,16 +107,17 @@ func main() {
return
}
webCrawlerInit()
err := InitIndex()
if err != nil {
printErr("Failed to initialize index:", err)
}
// Start periodic indexing (every 2 minutes)
dataFilePath := filepath.Join(config.DriveCache.Path, "data_to_index.txt")
startPeriodicIndexing(dataFilePath, 2*time.Minute)
webCrawlerInit()
// No longer needed as crawled data are indexed imidietly
// // Start periodic indexing (every 2 minutes)
// dataFilePath := filepath.Join(config.DriveCache.Path, "data_to_index.txt")
// startPeriodicIndexing(dataFilePath, 2*time.Minute)
printInfo("Indexer is enabled.")
} else {