Skip to content

Commit 6c21619

Browse files
authored
Merge pull request #1 from preprio/feactue/timeouts
Added timeout options
2 parents cc05123 + 6c1d852 commit 6c21619

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ Added config in you're .env file and config/services.php
1515
config/services.php
1616
1717
'prepr' => [
18-
'endpoint' => env('PREPR_ENDPOINT')
18+
'endpoint' => env('PREPR_ENDPOINT'),
19+
'timeout' => env('PREPR_TIMEOUT'),
20+
'connect_timeout' => env('PREPR_CONNECT_TIMEOUT')
1921
]
2022
```
2123

src/PreprServiceProvider.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ public function boot()
3939
$json['variables'] = data_get($data,'variables');
4040
}
4141

42-
return Http::acceptJson()->withHeaders($headers)->post(config('services.prepr.endpoint'), $json);
42+
return Http::acceptJson()
43+
->timeout(config('services.prepr.timeout',30))
44+
->connectTimeout(config('services.prepr.connect_timeout',10))
45+
->withHeaders($headers)
46+
->post(config('services.prepr.endpoint'), $json);
4347

4448
});
4549
}

0 commit comments

Comments
 (0)