fix bug with load path

This commit is contained in:
YouROK
2023-01-30 11:45:19 +03:00
parent 96f4bbf8ec
commit 12dcdf4ffc

View File

@@ -100,7 +100,7 @@ func updateDB() {
func loadDB() {
log.TLogln("Load rutor db")
buf, err := os.ReadFile("rutor.ls")
buf, err := os.ReadFile(filepath.Join(settings.Path, "rutor.ls"))
if err == nil {
r := flate.NewReader(bytes.NewReader(buf))
buf, err = io.ReadAll(r)
@@ -114,6 +114,8 @@ func loadDB() {
torrsearch.NewIndex(torrs)
}
}
} else {
log.TLogln("Error load rutor db:", err)
}
utils2.FreeOSMemGC()
}