Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleSanderson authored Nov 24, 2024
1 parent 1fdc5fc commit 31023f7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,16 @@ func (c *upgradereq) getAllTorrents() (*timeentry, error) {
return torrentmap.SetItem(set, &timeentry{}, ttlcache.DefaultTTL)
}

if c.CacheBypass == 0 {
return it
} else if c.CacheBypass == 1 {
if c.CacheBypass == 1 {
val := it.GetValue()
val.m.RLock()
defer val.m.RUnlock()
if val.e == nil {
return it
if val.e != nil {
return torrentmap.SetItem(set, &timeentry{}, ttlcache.DefaultTTL)
}
}

return torrentmap.SetItem(set, &timeentry{}, ttlcache.DefaultTTL)
return it
}

var te ttlcache.Item[*timeentry]
Expand Down

0 comments on commit 31023f7

Please sign in to comment.