From c68de455a9526b9c95e5dee523cd549783fa2f4e Mon Sep 17 00:00:00 2001 From: ZacharyMarlow Date: Thu, 29 Jan 2026 03:02:37 -0800 Subject: [PATCH] set timeout from constructor --- lib/HTTP/UserAgent.rakumod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/HTTP/UserAgent.rakumod b/lib/HTTP/UserAgent.rakumod index d1100e9..dc50a17 100644 --- a/lib/HTTP/UserAgent.rakumod +++ b/lib/HTTP/UserAgent.rakumod @@ -29,7 +29,7 @@ role Connection { } } -has Int $.timeout is rw = 180; +has Int $.timeout is rw; has $.useragent; has HTTP::Cookies $.cookies is rw = HTTP::Cookies.new( file => tempfile[0], @@ -71,7 +71,7 @@ my sub _index_buf(Blob $input, Blob $sub) { -1 } -submethod BUILD(:$!useragent, Bool :$!throw-exceptions, :$!max-redirects = 5, :$!debug, :$!redirects-in-a-row) { +submethod BUILD(:$!useragent, Bool :$!throw-exceptions, :$!max-redirects = 5, :$!debug, :$!redirects-in-a-row, :$!timeout = 180) { $!useragent = get-ua($!useragent) if $!useragent.defined; if $!debug.defined { if $!debug ~~ Bool and $!debug == True {