Skip to content

Commit

Permalink
remove local tc
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleSanderson authored Nov 24, 2024
1 parent 3b12e15 commit e0e176f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ type upgradereq struct {
}

type timeentry struct {
e map[string][]qbittorrent.Torrent
tc *timecache.Cache
m sync.RWMutex
e map[string][]qbittorrent.Torrent
m sync.RWMutex
}

var db *bolt.DB
Expand Down Expand Up @@ -166,7 +165,7 @@ func (c *upgradereq) getAllTorrents() (*timeentry, error) {
}
}

return torrentmap.SetItem(set, &timeentry{tc: timecache.New(timecache.Options{})}, ttlcache.DefaultTTL)
return torrentmap.SetItem(set, &timeentry{}, ttlcache.DefaultTTL)
}

var te ttlcache.Item[*timeentry]
Expand Down Expand Up @@ -197,7 +196,7 @@ func (c *upgradereq) getAllTorrents() (*timeentry, error) {
val.e[s] = append(val.e[s], t)
}

torrentmap.Set(set, val, val.tc.Now().Sub(te.GetTime().Add(-te.GetDuration())))
torrentmap.Set(set, val, globalTime.Now().Sub(te.GetTime().Add(-te.GetDuration())))
return nil
})

Expand Down

0 comments on commit e0e176f

Please sign in to comment.