fix AddExpiredTime function (#392)

This commit is contained in:
Oleg Shitikov
2024-05-13 16:14:04 +03:00
committed by GitHub
parent 21e29a8cfa
commit 92e8063d39

View File

@@ -143,7 +143,10 @@ func (t *Torrent) GotInfo() bool {
} }
func (t *Torrent) AddExpiredTime(duration time.Duration) { func (t *Torrent) AddExpiredTime(duration time.Duration) {
t.expiredTime = time.Now().Add(duration) newExpiredTime := time.Now().Add(duration)
if t.expiredTime.Before(newExpiredTime) {
t.expiredTime = newExpiredTime
}
} }
func (t *Torrent) watch() { func (t *Torrent) watch() {