Skip to content

Commit

Permalink
refactor: optimize timeout setting in initClient function
Browse files Browse the repository at this point in the history
  • Loading branch information
krau committed Oct 11, 2024
1 parent 0d369c7 commit 03c833a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/req.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package common

import (
"path/filepath"
"time"

"github.com/imroc/req/v3"
"github.com/krau/SaveAny-Bot/config"
Expand All @@ -10,7 +11,7 @@ import (
var ReqClient *req.Client

func initClient() {
ReqClient = req.NewClient().SetOutputDirectory(config.Cfg.Temp.BasePath)
ReqClient = req.NewClient().SetOutputDirectory(config.Cfg.Temp.BasePath).SetTimeout(86400 * time.Second)
}

func GetDownloadedFilePath(filename string) string {
Expand Down

0 comments on commit 03c833a

Please sign in to comment.