KMP PHP API Reference

PlatformJobRetentionService
in package

FinalYes

Prunes terminal platform jobs while preserving active work and longer-lived failures.

Table of Contents

Constants

DEFAULT_COMPLETED_DAYS  : mixed = 90
DEFAULT_FAILED_DAYS  : mixed = 180
DEFAULT_LIMIT  : mixed = 5000
DEFAULT_SCHEDULE_DAYS  : mixed = 14

Properties

$connection  : Connection

Methods

__construct()  : mixed
Constructor.
prune()  : array{schedule_completed: int, completed: int, failed: int}
assertDays()  : void
Validate a retention window.
deleteBatch()  : int
Delete one bounded batch of terminal jobs.

Constants

Properties

Methods

prune()

public prune([int $scheduleDays = self::DEFAULT_SCHEDULE_DAYS ][, int $completedDays = self::DEFAULT_COMPLETED_DAYS ][, int $failedDays = self::DEFAULT_FAILED_DAYS ][, int $limit = self::DEFAULT_LIMIT ][, DateTimeImmutable|null $now = null ]) : array{schedule_completed: int, completed: int, failed: int}
Parameters
$scheduleDays : int = self::DEFAULT_SCHEDULE_DAYS
$completedDays : int = self::DEFAULT_COMPLETED_DAYS
$failedDays : int = self::DEFAULT_FAILED_DAYS
$limit : int = self::DEFAULT_LIMIT
$now : DateTimeImmutable|null = null
Return values
array{schedule_completed: int, completed: int, failed: int}

assertDays()

Validate a retention window.

private assertDays(int $days, string $label) : void
Parameters
$days : int
$label : string

deleteBatch()

Delete one bounded batch of terminal jobs.

private deleteBatch(string $status, string $cutoff, int $limit, bool|null $scheduleOnly) : int
Parameters
$status : string
$cutoff : string
$limit : int
$scheduleOnly : bool|null
Return values
int
On this page

Search results