diff --git a/core/Controller/TaskProcessingApiController.php b/core/Controller/TaskProcessingApiController.php index 62708522ab454..72811eb044cdf 100644 --- a/core/Controller/TaskProcessingApiController.php +++ b/core/Controller/TaskProcessingApiController.php @@ -164,11 +164,13 @@ public function taskTypesExAppEndpoint(): DataResponse { private function handleScheduleTaskInternal( array $input, string $type, string $appId, string $customId = '', ?string $webhookUri = null, ?string $webhookMethod = null, bool $includeWatermark = true, + bool $preferStreaming = false, ): DataResponse { $task = new Task($type, $input, $appId, $this->userId, $customId); $task->setWebhookUri($webhookUri); $task->setWebhookMethod($webhookMethod); $task->setIncludeWatermark($includeWatermark); + $task->setPreferStreaming($preferStreaming); try { $this->taskProcessingManager->scheduleTask($task); @@ -202,6 +204,7 @@ private function handleScheduleTaskInternal( * @param string|null $webhookUri URI to be requested when the task finishes * @param string|null $webhookMethod Method used for the webhook request (HTTP:GET, HTTP:POST, HTTP:PUT, HTTP:DELETE or AppAPI:APP_ID:GET, AppAPI:APP_ID:POST...) * @param bool $includeWatermark Whether to include a watermark in the output file or not + * @param bool $preferStreaming Whether to prefer getting a progressive output from the provider or not * @return DataResponse|DataResponse * * 200: Task scheduled successfully @@ -215,6 +218,7 @@ private function handleScheduleTaskInternal( public function schedule( array $input, string $type, string $appId, string $customId = '', ?string $webhookUri = null, ?string $webhookMethod = null, bool $includeWatermark = true, + bool $preferStreaming = false, ): DataResponse { return $this->handleScheduleTaskInternal( $input, @@ -224,6 +228,7 @@ public function schedule( $webhookUri, $webhookMethod, $includeWatermark, + $preferStreaming, ); } @@ -239,6 +244,7 @@ public function schedule( * @param string|null $webhookUri URI to be requested when the task finishes * @param string|null $webhookMethod Method used for the webhook request (HTTP:GET, HTTP:POST, HTTP:PUT, HTTP:DELETE or AppAPI:APP_ID:GET, AppAPI:APP_ID:POST...) * @param bool $includeWatermark Whether to include a watermark in the output file or not + * @param bool $preferStreaming Whether to prefer getting a progressive output from the provider or not * @return DataResponse|DataResponse * * 200: Task scheduled successfully @@ -251,6 +257,7 @@ public function schedule( public function scheduleExAppEndpoint( array $input, string $type, string $appId, string $customId = '', ?string $webhookUri = null, ?string $webhookMethod = null, bool $includeWatermark = true, + bool $preferStreaming = false, ): DataResponse { return $this->handleScheduleTaskInternal( $input, @@ -260,6 +267,7 @@ public function scheduleExAppEndpoint( $webhookUri, $webhookMethod, $includeWatermark, + $preferStreaming, ); } diff --git a/core/Migrations/Version35000Date20260527162338.php b/core/Migrations/Version35000Date20260527162338.php index c3be6d59fb3c1..a661c728565b7 100644 --- a/core/Migrations/Version35000Date20260527162338.php +++ b/core/Migrations/Version35000Date20260527162338.php @@ -39,7 +39,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt if (!$table->hasColumn('prefer_streaming')) { $table->addColumn('prefer_streaming', Types::SMALLINT, [ 'notnull' => true, - 'default' => 1, + 'default' => 0, 'unsigned' => true, ]); return $schema; diff --git a/core/openapi-ex_app.json b/core/openapi-ex_app.json index 7447400719cac..17dbd07fe1ae5 100644 --- a/core/openapi-ex_app.json +++ b/core/openapi-ex_app.json @@ -647,6 +647,11 @@ "type": "boolean", "default": true, "description": "Whether to include a watermark in the output file or not" + }, + "preferStreaming": { + "type": "boolean", + "default": false, + "description": "Whether to prefer getting a progressive output from the provider or not" } } } diff --git a/core/openapi-full.json b/core/openapi-full.json index 47b0bb6cfa129..304c13daf1ed0 100644 --- a/core/openapi-full.json +++ b/core/openapi-full.json @@ -5098,6 +5098,11 @@ "type": "boolean", "default": true, "description": "Whether to include a watermark in the output file or not" + }, + "preferStreaming": { + "type": "boolean", + "default": false, + "description": "Whether to prefer getting a progressive output from the provider or not" } } } @@ -10457,6 +10462,11 @@ "type": "boolean", "default": true, "description": "Whether to include a watermark in the output file or not" + }, + "preferStreaming": { + "type": "boolean", + "default": false, + "description": "Whether to prefer getting a progressive output from the provider or not" } } } diff --git a/core/openapi.json b/core/openapi.json index 7981b3763bf46..cd621b5daf669 100644 --- a/core/openapi.json +++ b/core/openapi.json @@ -5098,6 +5098,11 @@ "type": "boolean", "default": true, "description": "Whether to include a watermark in the output file or not" + }, + "preferStreaming": { + "type": "boolean", + "default": false, + "description": "Whether to prefer getting a progressive output from the provider or not" } } } diff --git a/lib/public/TaskProcessing/SynchronousProviderOptions.php b/lib/public/TaskProcessing/SynchronousProviderOptions.php index 982f01da501c4..1381040b5d31c 100644 --- a/lib/public/TaskProcessing/SynchronousProviderOptions.php +++ b/lib/public/TaskProcessing/SynchronousProviderOptions.php @@ -22,7 +22,7 @@ class SynchronousProviderOptions { */ public function __construct( private readonly bool $includeWatermarks = false, - private readonly bool $preferStreaming = true, + private readonly bool $preferStreaming = false, ?callable $reportIntermediateOutput = null, ) { $this->reportIntermediateOutput = $reportIntermediateOutput !== null diff --git a/lib/public/TaskProcessing/Task.php b/lib/public/TaskProcessing/Task.php index e6e73bf5082ac..4fd3ae4faf82d 100644 --- a/lib/public/TaskProcessing/Task.php +++ b/lib/public/TaskProcessing/Task.php @@ -51,7 +51,7 @@ final class Task implements \JsonSerializable { protected bool $includeWatermark = true; - protected bool $preferStreaming = true; + protected bool $preferStreaming = false; /** * @since 30.0.0 diff --git a/openapi.json b/openapi.json index 2d462fb641536..4e5683d70053a 100644 --- a/openapi.json +++ b/openapi.json @@ -8803,6 +8803,11 @@ "type": "boolean", "default": true, "description": "Whether to include a watermark in the output file or not" + }, + "preferStreaming": { + "type": "boolean", + "default": false, + "description": "Whether to prefer getting a progressive output from the provider or not" } } } @@ -14165,6 +14170,11 @@ "type": "boolean", "default": true, "description": "Whether to include a watermark in the output file or not" + }, + "preferStreaming": { + "type": "boolean", + "default": false, + "description": "Whether to prefer getting a progressive output from the provider or not" } } }