mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
Merge d4ce68e0f9 into d09b8c99de
This commit is contained in:
commit
958e668f8b
2 changed files with 27 additions and 0 deletions
|
|
@ -213,5 +213,10 @@ class App {
|
|||
$io->setOutput($output);
|
||||
}
|
||||
}
|
||||
|
||||
if ($response->getFlushEarly()) {
|
||||
ob_flush();
|
||||
flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ class Response {
|
|||
|
||||
/** @var bool */
|
||||
private $throttled = false;
|
||||
private bool $flushEarly = true;
|
||||
/** @var array */
|
||||
private $throttleMetadata = [];
|
||||
|
||||
|
|
@ -412,4 +413,25 @@ class Response {
|
|||
public function isThrottled() {
|
||||
return $this->throttled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request the response should be flushed to the connected client immediately
|
||||
*
|
||||
* @since 34.0.0
|
||||
*/
|
||||
public function setFlushEarly(bool $flushEarly): void {
|
||||
$this->flushEarly = $flushEarly;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the response should be flushed to the connected client immediately
|
||||
*
|
||||
* If not, the response will wait for async actions, e.g. HTTP requests from
|
||||
* IClientService, to be finished before returning.
|
||||
*
|
||||
* @since 34.0.0
|
||||
*/
|
||||
public function getFlushEarly(): bool {
|
||||
return $this->flushEarly;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue