Skip to content

Commit

Permalink
reintroduce infohash cache
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdy committed Nov 20, 2023
1 parent 2370cea commit 4ec9796
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

var InfoHashCache = mapset.NewSet[[20]byte]()

func PopulateInfoHashCacheFromDatabase(database clover.DB) {
func PopulateInfoHashCacheFromDatabase(database *clover.DB) {
all, _ := database.FindAll(query.NewQuery(db.TorrentTable))
for _, d := range all {
ih := d.Get("InfoHash").(string)
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ func main() {
cfg := config.ParseArguments()
database := db.OpenDatabase(cfg)

cache.PopulateInfoHashCacheFromDatabase(database)

db.AddToBlacklist(database, ReadFileLines(cfg.NameBlacklist), "0")
db.AddToBlacklist(database, ReadFileLines(cfg.FileBlacklist), "1")

Expand Down

0 comments on commit 4ec9796

Please sign in to comment.