mirror of
https://codeberg.org/hyperreal/go-transmission-stats
synced 2024-11-25 12:13:42 +01:00
Add context.TODO() to torrent-get functions
This commit is contained in:
parent
7ef4dde3b1
commit
50115dc2de
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"log"
|
"log"
|
||||||
@ -90,7 +91,7 @@ func main() {
|
|||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
stats, err := transmissionbt.SessionStats()
|
stats, err := transmissionbt.SessionStats(context.TODO())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
@ -125,7 +126,7 @@ func main() {
|
|||||||
seederCount int64
|
seederCount int64
|
||||||
)
|
)
|
||||||
|
|
||||||
torrents, err := transmissionbt.TorrentGet([]string{"name", "activityDate", "totalSize", "trackerStats"}, nil)
|
torrents, err := transmissionbt.TorrentGet(context.TODO(), []string{"name", "activityDate", "totalSize", "trackerStats"}, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
} else {
|
} else {
|
||||||
|
5
main.go
5
main.go
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
@ -92,7 +93,7 @@ func main() {
|
|||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
stats, err := transmissionbt.SessionStats()
|
stats, err := transmissionbt.SessionStats(context.TODO())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
@ -140,7 +141,7 @@ func main() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
fmt.Println("TORRENT STATS")
|
fmt.Println("TORRENT STATS")
|
||||||
torrents, err := transmissionbt.TorrentGet([]string{
|
torrents, err := transmissionbt.TorrentGet(context.TODO(), []string{
|
||||||
"activityDate",
|
"activityDate",
|
||||||
"name",
|
"name",
|
||||||
"totalSize",
|
"totalSize",
|
||||||
|
Loading…
Reference in New Issue
Block a user