diff options
Diffstat (limited to 'core/Command/Background/JobBase.php')
-rw-r--r-- | core/Command/Background/JobBase.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/core/Command/Background/JobBase.php b/core/Command/Background/JobBase.php index 756e0ad7b80..81d16f874eb 100644 --- a/core/Command/Background/JobBase.php +++ b/core/Command/Background/JobBase.php @@ -10,16 +10,19 @@ declare(strict_types=1); namespace OC\Core\Command\Background; +use OC\Core\Command\Base; use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\IJobList; +use OCP\BackgroundJob\QueuedJob; +use OCP\BackgroundJob\TimedJob; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Output\OutputInterface; -abstract class JobBase extends \OC\Core\Command\Base { +abstract class JobBase extends Base { public function __construct( protected IJobList $jobList, - protected LoggerInterface $logger + protected LoggerInterface $logger, ) { parent::__construct(); } @@ -32,19 +35,19 @@ abstract class JobBase extends \OC\Core\Command\Base { } $lastRun = new \DateTime(); - $lastRun->setTimestamp((int) $row['last_run']); + $lastRun->setTimestamp((int)$row['last_run']); $lastChecked = new \DateTime(); - $lastChecked->setTimestamp((int) $row['last_checked']); + $lastChecked->setTimestamp((int)$row['last_checked']); $reservedAt = new \DateTime(); - $reservedAt->setTimestamp((int) $row['reserved_at']); + $reservedAt->setTimestamp((int)$row['reserved_at']); $output->writeln('Job class: ' . get_class($job)); $output->writeln('Arguments: ' . json_encode($job->getArgument())); - $isTimedJob = $job instanceof \OCP\BackgroundJob\TimedJob; + $isTimedJob = $job instanceof TimedJob; if ($isTimedJob) { $output->writeln('Type: timed'); - } elseif ($job instanceof \OCP\BackgroundJob\QueuedJob) { + } elseif ($job instanceof QueuedJob) { $output->writeln('Type: queued'); } else { $output->writeln('Type: job'); @@ -52,7 +55,7 @@ abstract class JobBase extends \OC\Core\Command\Base { $output->writeln(''); $output->writeln('Last checked: ' . $lastChecked->format(\DateTimeInterface::ATOM)); - if ((int) $row['reserved_at'] === 0) { + if ((int)$row['reserved_at'] === 0) { $output->writeln('Reserved at: -'); } else { $output->writeln('Reserved at: <comment>' . $reservedAt->format(\DateTimeInterface::ATOM) . '</comment>'); |