added more config values for indexing + fixed value handling when Its missing in config file
This commit is contained in:
parent
047cccd19f
commit
13e1d6119b
3 changed files with 153 additions and 94 deletions
|
@ -28,12 +28,12 @@ var (
|
|||
bleveIndex bleve.Index
|
||||
)
|
||||
|
||||
// startPeriodicIndexing refreshes the index from a file periodically
|
||||
func startPeriodicIndexing(filePath string, interval time.Duration) {
|
||||
go func() {
|
||||
for {
|
||||
printDebug("Refreshing index from %s", filePath)
|
||||
err := IndexFile(filePath)
|
||||
if err != nil {
|
||||
if err := IndexFile(filePath); err != nil {
|
||||
printErr("Failed to refresh index: %v", err)
|
||||
}
|
||||
time.Sleep(interval)
|
||||
|
@ -139,7 +139,7 @@ func IndexFile(filePath string) error {
|
|||
return fmt.Errorf("error reading file: %v", err)
|
||||
}
|
||||
|
||||
printDebug("Indexed %d unique domains from %s\n", len(indexedDomains), filePath)
|
||||
printDebug("Indexed %d unique domains from %s", len(indexedDomains), filePath)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue