diff options
Diffstat (limited to 'core/Command/Background')
-rw-r--r-- | core/Command/Background/Job.php | 8 | ||||
-rw-r--r-- | core/Command/Background/JobBase.php | 9 |
2 files changed, 11 insertions, 6 deletions
diff --git a/core/Command/Background/Job.php b/core/Command/Background/Job.php index 7fa005cf231..9a862f5a13a 100644 --- a/core/Command/Background/Job.php +++ b/core/Command/Background/Job.php @@ -10,6 +10,8 @@ namespace OC\Core\Command\Background; use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\IJobList; +use OCP\BackgroundJob\QueuedJob; +use OCP\BackgroundJob\TimedJob; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -75,7 +77,7 @@ class Job extends Command { $output->writeln('<info>Job executed!</info>'); $output->writeln(''); - if ($job instanceof \OCP\BackgroundJob\TimedJob) { + if ($job instanceof TimedJob) { $this->printJobInfo($jobId, $job, $output); } } else { @@ -99,10 +101,10 @@ class Job extends Command { $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'); diff --git a/core/Command/Background/JobBase.php b/core/Command/Background/JobBase.php index d92bb77d4b6..81d16f874eb 100644 --- a/core/Command/Background/JobBase.php +++ b/core/Command/Background/JobBase.php @@ -10,12 +10,15 @@ 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, @@ -41,10 +44,10 @@ abstract class JobBase extends \OC\Core\Command\Base { $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'); |