Skip to content

Commit 9abc3b9

Browse files
committed
Make warming actually work?
1 parent 70b3ff0 commit 9abc3b9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Manager.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,17 @@ public function instantiatedFunctions($functions = null)
202202
*/
203203
public function warm($functions = null)
204204
{
205-
array_map(function (LambdaFunction $function) {
206-
$this->warmSingle($function);
205+
$results = array_map(function (LambdaFunction $function) {
206+
return $this->warmSingle($function);
207207
}, $this->instantiatedFunctions($functions));
208+
209+
$results = Arr::flatten($results, 1);
210+
211+
// The requests will never be sent unless we wait for them to
212+
// settle, because of how Guzzle handles async requests.
213+
array_map(function ($result) {
214+
return $result->settled();
215+
}, $results);
208216
}
209217

210218
/**

0 commit comments

Comments
 (0)