Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #663 error in cron.php since NC 29 #725

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
32 changes: 9 additions & 23 deletions lib/Cron/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

namespace OCA\Backup\Cron;

use OC\BackgroundJob\TimedJob;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
use OCA\Backup\Exceptions\JobsTimeSlotException;
use OCA\Backup\Service\ConfigService;
use OCA\Backup\Service\CronService;
Expand All @@ -48,39 +49,24 @@
class Backup extends TimedJob {
use TNCLogger;


/** @var PointService */
private $pointService;

/** @var CronService */
private $cronService;

/** @var ConfigService */
private $configService;

/** @var LoggerInterface */
private $loggerInterface;

/**
* Backup constructor.
*
* @param ITimeFactory $time
* @param PointService $pointService
* @param CronService $cronService
* @param ConfigService $configService
* @param LoggerInterface $loggerInterface
*/
public function __construct(
PointService $pointService,
CronService $cronService,
ConfigService $configService,
LoggerInterface $loggerInterface
ITimeFactory $time,
private PointService $pointService,
private CronService $cronService,
private ConfigService $configService,
private LoggerInterface $loggerInterface
) {
parent::__construct($time);
$this->setInterval(900);

$this->pointService = $pointService;
$this->cronService = $cronService;
$this->configService = $configService;
$this->loggerInterface = $loggerInterface;
}


Expand Down
39 changes: 10 additions & 29 deletions lib/Cron/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

namespace OCA\Backup\Cron;

use OC\BackgroundJob\TimedJob;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
use OCA\Backup\Db\EventRequest;
use OCA\Backup\Model\BackupEvent;
use OCA\Backup\Service\ConfigService;
Expand All @@ -48,46 +49,26 @@
class Event extends TimedJob {
use TArrayTools;


/** @var EventRequest */
private $eventRequest;

/** @var PointService */
private $pointService;

/** @var FilesService */
private $filesService;

/** @var CronService */
private $cronService;

/** @var ConfigService */
private $configService;


/**
* Event constructor.
*
* @param ITimeFactory $time
* @param EventRequest $eventRequest
* @param PointService $pointService
* @param FilesService $filesService
* @param CronService $cronService
* @param ConfigService $configService
*/
public function __construct(
EventRequest $eventRequest,
PointService $pointService,
FilesService $filesService,
CronService $cronService,
ConfigService $configService
ITimeFactory $time,
private EventRequest $eventRequest,
private PointService $pointService,
private FilesService $filesService,
private CronService $cronService,
private ConfigService $configService
) {
parent::__construct($time);
$this->setInterval(1);

$this->eventRequest = $eventRequest;
$this->pointService = $pointService;
$this->filesService = $filesService;
$this->cronService = $cronService;
$this->configService = $configService;
}


Expand Down
50 changes: 12 additions & 38 deletions lib/Cron/Manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

namespace OCA\Backup\Cron;

use OC\BackgroundJob\TimedJob;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
use OCA\Backup\Exceptions\ExternalFolderNotFoundException;
use OCA\Backup\Exceptions\JobsTimeSlotException;
use OCA\Backup\Model\RestoringPoint;
Expand All @@ -52,31 +53,10 @@
class Manage extends TimedJob {
public const DELAY_CHECK_HEALTH = 86400 * 7; // 7d

/** @var CronService */
private $cronService;

/** @var PointService */
private $pointService;

/** @var PackService */
private $packService;

/** @var UploadService */
private $uploadService;

/** @var ExternalFolderService */
private $externalFolderService;

/** @var OutputService */
private $outputService;

/** @var ConfigService */
private $configService;


/**
* Manage constructor.
*
* @param ITimeFactory $time
* @param CronService $cronService
* @param PointService $pointService
* @param PackService $packService
Expand All @@ -86,23 +66,17 @@ class Manage extends TimedJob {
* @param ConfigService $configService
*/
public function __construct(
CronService $cronService,
PointService $pointService,
PackService $packService,
UploadService $uploadService,
ExternalFolderService $externalFolderService,
OutputService $outputService,
ConfigService $configService
ITimeFactory $time,
private CronService $cronService,
private PointService $pointService,
private PackService $packService,
private UploadService $uploadService,
private ExternalFolderService $externalFolderService,
private OutputService $outputService,
private ConfigService $configService
) {
parent::__construct($time);
$this->setInterval(3600);

$this->cronService = $cronService;
$this->pointService = $pointService;
$this->packService = $packService;
$this->uploadService = $uploadService;
$this->externalFolderService = $externalFolderService;
$this->outputService = $outputService;
$this->configService = $configService;
}


Expand Down