Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong committed Jul 23, 2024
1 parent ef98461 commit d60558a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ func (tm *TorrentManager) pendingLoop() {
t := m.T
if t.Torrent.Info() != nil {
t.AddTrackers(slices.Clone(tm.globalTrackers))
tm.meta(t)
tm.active(t)
continue
}

Expand All @@ -1057,13 +1057,13 @@ func (tm *TorrentManager) pendingLoop() {

ctx, cancel := context.WithTimeout(context.Background(), (10+time.Duration(tm.slot&9))*time.Minute)
defer cancel()
timer := time.NewTimer(time.Second * 15)
timer := time.NewTimer(time.Second * 5)
defer timer.Stop()
for {
select {
case <-t.Torrent.GotInfo():
log.Info("Searching", "ih", t.InfoHash(), "elapsed", common.PrettyDuration(time.Duration(mclock.Now())-time.Duration(t.Birth())))
tm.meta(t)
tm.active(t)
return
case <-t.Closed():
return
Expand All @@ -1088,7 +1088,7 @@ func (tm *TorrentManager) pendingLoop() {
}
}

func (tm *TorrentManager) meta(t *caffe.Torrent) error {
func (tm *TorrentManager) active(t *caffe.Torrent) error {
if b, err := bencode.Marshal(t.Torrent.Info()); err == nil {
if tm.kvdb != nil && tm.kvdb.Get([]byte(SEED_PRE+t.InfoHash())) == nil {
if tm.mode != params.LAZY {
Expand Down

0 comments on commit d60558a

Please sign in to comment.