]> Sergey Matveev's repositories - btrtrc.git/commitdiff
cmd/torrent: Remove redundant signal notification
authorMatt Joiner <anacrolix@gmail.com>
Wed, 9 Apr 2025 00:03:44 +0000 (10:03 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 9 Apr 2025 00:03:44 +0000 (10:03 +1000)
cmd/torrent/download.go

index e3cbdf5ff35b11880a520bbf24517a60408a787e..0a7f991f160445993e6df0a06f1bc8562ea860fc 100644 (file)
@@ -8,10 +8,8 @@ import (
        "net"
        "net/http"
        "os"
-       "os/signal"
        "strings"
        "sync"
-       "syscall"
        "time"
 
        "github.com/anacrolix/log"
@@ -350,9 +348,6 @@ func downloadErr(ctx context.Context, flags downloadFlags) error {
                clientConfig.MaxUnverifiedBytes = flags.MaxUnverifiedBytes.Int64()
        }
 
-       ctx, cancel := signal.NotifyContext(ctx, os.Interrupt, syscall.SIGTERM)
-       defer cancel()
-
        client, err := torrent.NewClient(clientConfig)
        if err != nil {
                return fmt.Errorf("creating client: %w", err)