Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong committed Jan 3, 2024
1 parent bb5dc3b commit 1eba26d
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions backend/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,19 +229,20 @@ func (tm *TorrentManager) Search(ctx context.Context, hex string, request uint64
// return nil
}

return tm.commit(ctx, hex, request)
//return tm.commit(ctx, hex, request)
return tm.taskEvent.Post(mainEvent{B: types.NewBitsFlow(hex, request)})
}

// Add torrent to the leeching loop
func (tm *TorrentManager) commit(ctx context.Context, hex string, request uint64) error {
/*select {
case tm.taskChan <- types.NewBitsFlow(hex, request):
case <-ctx.Done():
return ctx.Err()
case <-tm.closeAll:
}
//func (tm *TorrentManager) commit(ctx context.Context, hex string, request uint64) error {
/*select {
case tm.taskChan <- types.NewBitsFlow(hex, request):
case <-ctx.Done():
return ctx.Err()
case <-tm.closeAll:
}
return nil */
return nil */

return tm.taskEvent.Post(mainEvent{types.NewBitsFlow(hex, request)})
}
// return tm.taskEvent.Post(mainEvent{types.NewBitsFlow(hex, request)})
//}

0 comments on commit 1eba26d

Please sign in to comment.