Skip to content

Commit

Permalink
implement not-recommended CacheBypass flag
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleSanderson authored Aug 13, 2023
1 parent eb57691 commit 6d31d30
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ type Entry struct {
type upgradereq struct {
Name string

User string
Password string
Host string
Port uint
User string
Password string
Host string
Port uint
CacheBypass uint

Hash string
Torrent json.RawMessage
Expand Down Expand Up @@ -148,15 +149,15 @@ func (c *upgradereq) getAllTorrents() timeentry {

res := f()
cur := time.Now()
if res.t.After(cur) {
if c.CacheBypass == 0 && res.t.After(cur) {
return *res
}

res.Lock()
defer res.Unlock()

res = f()
if res.t.After(cur) {
if c.CacheBypass == 0 && res.t.After(cur) {
return *res
}

Expand Down

0 comments on commit 6d31d30

Please sign in to comment.