Skip to content

Commit c754c21

Browse files
Add actual timeout when getting shadow feed
1 parent 7d7d5c3 commit c754c21

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

webapp/src/Service/ExternalContestSourceService.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,10 @@ protected function importFromCcsApi(array $eventsToSkip, ?callable $progressRepo
381381
};
382382

383383
while (true) {
384-
// A timeout of 0.0 means we get chunks immediately and the user
385-
// can cancel at any time.
386384
try {
387385
$receivedData = false;
388-
foreach ($this->httpClient->stream($response, 0.0) as $chunk) {
386+
// Get a timeout chunk after 1 second so we don't hang indefinitely.
387+
foreach ($this->httpClient->stream($response, 1.0) as $chunk) {
389388
// We first need to check for timeouts, as we can not call
390389
// ->isLast() or ->getContent() on them.
391390
if (!$chunk->isTimeout()) {

0 commit comments

Comments
 (0)