Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleSanderson authored Nov 24, 2024
1 parent c8b4ecd commit f790c4a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,16 @@ func (c *upgradereq) getAllTorrents() (*timeentry, error) {

getOrInitialize := func() ttlcache.Item[*timeentry] {
if it, ok := torrentmap.GetItem(set); ok {
val := it.GetValue()
val.m.RLock()
defer val.m.RUnlock()

if c.CacheBypass == 0 || (c.CacheBypass == 1 && len(val.e) == 0) {
if c.CacheBypass == 0 {
return it
} else if c.CacheBypass == 1 {
val := it.GetValue()
val.m.RLock()
defer val.m.RUnlock()

if val.e == nil {
return it
}
}
}

Expand Down

0 comments on commit f790c4a

Please sign in to comment.