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
6 changes: 4 additions & 2 deletions apps/dav/lib/BackgroundJob/RefreshWebcalJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
namespace OCA\DAV\BackgroundJob;

use DateInterval;
use OC\BackgroundJob\Job;
use OCA\DAV\CalDAV\WebcalCaching\RefreshWebcalService;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\Job;
use OCP\IConfig;
use OCP\ILogger;
use Sabre\VObject\DateTimeParser;
Expand Down Expand Up @@ -65,6 +66,7 @@ class RefreshWebcalJob extends Job {
* @param ITimeFactory $timeFactory
*/
public function __construct(RefreshWebcalService $refreshWebcalService, IConfig $config, ILogger $logger, ITimeFactory $timeFactory) {
parent::__construct($timeFactory);
$this->refreshWebcalService = $refreshWebcalService;
$this->config = $config;
$this->logger = $logger;
Expand All @@ -76,7 +78,7 @@ public function __construct(RefreshWebcalService $refreshWebcalService, IConfig
*
* @inheritdoc
*/
public function execute($jobList, ILogger $logger = null) {
public function execute(IJobList $jobList, ILogger $logger = null) {
$subscription = $this->refreshWebcalService->getSubscription($this->argument['principaluri'], $this->argument['uri']);
if (!$subscription) {
return;
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/tests/unit/BackgroundJob/RefreshWebcalJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ protected function setUp(): void {
*/
public function testRun(int $lastRun, int $time, bool $process) {
$backgroundJob = new RefreshWebcalJob($this->refreshWebcalService, $this->config, $this->logger, $this->timeFactory);
$backgroundJob->setId(42);

$backgroundJob->setArgument([
'principaluri' => 'principals/users/testuser',
Expand All @@ -99,8 +100,7 @@ public function testRun(int $lastRun, int $time, bool $process) {
->with('dav', 'calendarSubscriptionRefreshRate', 'P1W')
->willReturn('P1W');

$this->timeFactory->expects($this->once())
->method('getTime')
$this->timeFactory->method('getTime')
->willReturn($time);

if ($process) {
Expand Down
7 changes: 3 additions & 4 deletions apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@

namespace OCA\FederatedFileSharing\BackgroundJob;

use OC\BackgroundJob\Job;
use OC\BackgroundJob\JobList;
use OCA\FederatedFileSharing\AddressHandler;
use OCA\FederatedFileSharing\Notifications;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\Job;
use OCP\ILogger;

/**
Expand Down Expand Up @@ -84,10 +83,10 @@ public function __construct(Notifications $notifications = null) {
/**
* run the job, then remove it from the jobList
*
* @param JobList $jobList
* @param IJobList $jobList
* @param ILogger|null $logger
*/
public function execute($jobList, ILogger $logger = null) {
public function execute(IJobList $jobList, ILogger $logger = null) {
if ($this->shouldRun($this->argument)) {
parent::execute($jobList, $logger);
$jobList->remove($this, $this->argument);
Expand Down
7 changes: 3 additions & 4 deletions apps/federation/lib/BackgroundJob/GetSharedSecret.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Ring\Exception\RingException;
use OC\BackgroundJob\Job;
use OC\BackgroundJob\JobList;
use OCA\Federation\TrustedServers;
use OCP\AppFramework\Http;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\Job;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
Expand Down Expand Up @@ -115,7 +114,7 @@ public function __construct(
/**
* run the job, then remove it from the joblist
*
* @param JobList $jobList
* @param IJobList $jobList
* @param ILogger|null $logger
*/
public function execute(IJobList $jobList, ILogger $logger = null) {
Expand All @@ -135,7 +134,7 @@ public function execute(IJobList $jobList, ILogger $logger = null) {
/**
* call execute() method of parent
*
* @param JobList $jobList
* @param IJobList $jobList
* @param ILogger $logger
*/
protected function parentExecute($jobList, $logger = null) {
Expand Down
7 changes: 3 additions & 4 deletions apps/federation/lib/BackgroundJob/RequestSharedSecret.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Ring\Exception\RingException;
use OC\BackgroundJob\Job;
use OC\BackgroundJob\JobList;
use OCA\Federation\TrustedServers;
use OCP\AppFramework\Http;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\Job;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\ILogger;
Expand Down Expand Up @@ -114,7 +113,7 @@ public function __construct(
/**
* run the job, then remove it from the joblist
*
* @param JobList $jobList
* @param IJobList $jobList
* @param ILogger|null $logger
*/
public function execute(IJobList $jobList, ILogger $logger = null) {
Expand All @@ -134,7 +133,7 @@ public function execute(IJobList $jobList, ILogger $logger = null) {
/**
* call execute() method of parent
*
* @param JobList $jobList
* @param IJobList $jobList
* @param ILogger $logger
*/
protected function parentExecute($jobList, $logger) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function __construct(ITimeFactory $time,
* @param IJobList $jobList
* @param ILogger|null $logger
*/
public function execute($jobList, ILogger $logger = null): void {
public function execute(IJobList $jobList, ILogger $logger = null): void {
if (!isset($this->argument['userId'])) {
// Old background job without user id, just drop it.
$jobList->remove($this, $this->argument);
Expand Down
7 changes: 3 additions & 4 deletions apps/settings/lib/BackgroundJobs/VerifyUserData.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@
namespace OCA\Settings\BackgroundJobs;

use OC\Accounts\AccountManager;
use OC\BackgroundJob\Job;
use OC\BackgroundJob\JobList;
use OCP\AppFramework\Http;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\Job;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\ILogger;
Expand Down Expand Up @@ -96,10 +95,10 @@ public function __construct(AccountManager $accountManager,
/**
* run the job, then remove it from the jobList
*
* @param JobList $jobList
* @param IJobList $jobList
* @param ILogger|null $logger
*/
public function execute($jobList, ILogger $logger = null) {
public function execute(IJobList $jobList, ILogger $logger = null) {
if ($this->shouldRun($this->argument)) {
parent::execute($jobList, $logger);
$jobList->remove($this, $this->argument);
Expand Down