aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/TaskProcessing/Task.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/TaskProcessing/Task.php')
-rw-r--r--lib/public/TaskProcessing/Task.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/public/TaskProcessing/Task.php b/lib/public/TaskProcessing/Task.php
index 71c271cd43d..06dc84d59ff 100644
--- a/lib/public/TaskProcessing/Task.php
+++ b/lib/public/TaskProcessing/Task.php
@@ -66,6 +66,7 @@ final class Task implements \JsonSerializable {
protected ?int $scheduledAt = null;
protected ?int $startedAt = null;
protected ?int $endedAt = null;
+ protected bool $allowCleanup = true;
/**
* @param string $taskTypeId
@@ -253,7 +254,23 @@ final class Task implements \JsonSerializable {
}
/**
- * @psalm-return array{id: int, lastUpdated: int, type: string, status: 'STATUS_CANCELLED'|'STATUS_FAILED'|'STATUS_SUCCESSFUL'|'STATUS_RUNNING'|'STATUS_SCHEDULED'|'STATUS_UNKNOWN', userId: ?string, appId: string, input: array<string, list<numeric|string>|numeric|string>, output: ?array<string, list<numeric|string>|numeric|string>, customId: ?string, completionExpectedAt: ?int, progress: ?float, scheduledAt: ?int, startedAt: ?int, endedAt: ?int}
+ * @return bool
+ * @since 32.0.0
+ */
+ final public function getAllowCleanup(): bool {
+ return $this->allowCleanup;
+ }
+
+ /**
+ * @param bool $allowCleanup
+ * @since 32.0.0
+ */
+ final public function setAllowCleanup(bool $allowCleanup): void {
+ $this->allowCleanup = $allowCleanup;
+ }
+
+ /**
+ * @psalm-return array{id: int, lastUpdated: int, type: string, status: 'STATUS_CANCELLED'|'STATUS_FAILED'|'STATUS_SUCCESSFUL'|'STATUS_RUNNING'|'STATUS_SCHEDULED'|'STATUS_UNKNOWN', userId: ?string, appId: string, input: array<string, list<numeric|string>|numeric|string>, output: ?array<string, list<numeric|string>|numeric|string>, customId: ?string, completionExpectedAt: ?int, progress: ?float, scheduledAt: ?int, startedAt: ?int, endedAt: ?int, allowCleanup: bool}
* @since 30.0.0
*/
final public function jsonSerialize(): array {
@@ -272,6 +289,7 @@ final class Task implements \JsonSerializable {
'scheduledAt' => $this->getScheduledAt(),
'startedAt' => $this->getStartedAt(),
'endedAt' => $this->getEndedAt(),
+ 'allowCleanup' => $this->getAllowCleanup(),
];
}