🔨 Move duration cancel logic to requests package

This commit is contained in:
2025-04-01 21:10:02 +04:00
parent abaa8e90b2
commit 415d0130ce
2 changed files with 7 additions and 5 deletions

View File

@@ -7,7 +7,6 @@ import (
"os"
"os/signal"
"syscall"
"time"
"github.com/aykhans/dodo/config"
"github.com/aykhans/dodo/requests"
@@ -50,10 +49,6 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
go listenForTermination(func() { cancel() })
if requestConf.Duration > 0 {
time.AfterFunc(requestConf.Duration, func() { cancel() })
}
responses, err := requests.Run(ctx, requestConf)
if err != nil {
if err == types.ErrInterrupt {