Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions core/BackgroundJobs/CleanupBackgroundJobsJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ private function reapCrashedJobs(): void {
if ($job->serverId !== $currentServerId) {
continue;
}
$output = [];
$result = 0;
exec('ps -p ' . escapeshellarg((string)$job->pid) . ' -o cmd', $output, $result);
if (count($output) === 1 && current($output) === 'CMD' && $result === 1) {
// Process doesn't exists anymore
$processExists = posix_kill($job->pid, 0) || posix_get_last_error() === 1 /* EPERM */;
if (!$processExists) {
// Process doesn't exist anymore
$maxDuration = (new DateTimeImmutable())->diff($job->startedAt);
$maxDuration
= ($maxDuration->days * 24 * 60 * 60 * 1000)
Expand Down
1 change: 0 additions & 1 deletion lib/private/BackgroundJob/JobRuns.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public function finished(int|string $runId, int $duration, int $memoryPeakUsage,

public function deleteBefore(int $timestamp): int {
$beforeSnowflake = $this->snowflakeGenerator->minForTimeId($timestamp);
$beforeSnowflake = '91480652934574081';
$qb = $this->connection->getQueryBuilder();
$result = $qb
->delete(self::TABLE)
Expand Down
Loading