use OCA\ContactsInteraction\Db\RecentContactMapper;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\TimedJob;
class CleanupJob extends TimedJob {
parent::__construct($time);
$this->setInterval(24 * 60 * 60);
- $this->setTimeSensitivity(IJob::TIME_INSENSITIVE);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
use OC\User\NoUserException;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\TimedJob;
use OCP\Files\File;
// Run once a day
$this->setInterval(60 * 60 * 24);
- $this->setTimeSensitivity(IJob::TIME_INSENSITIVE);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
protected function run($argument) {
parent::__construct($timeFactory);
// Run once a day
$this->setInterval(24 * 60 * 60);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
$this->syncService = $syncService;
$this->logger = $logger;
}
use OCP\DirectEditing\IManager;
class CleanupDirectEditingTokens extends TimedJob {
- private const INTERVAL_MINUTES = 15 * 60;
-
private IManager $manager;
public function __construct(ITimeFactory $time,
IManager $manager) {
parent::__construct($time);
- $this->interval = self::INTERVAL_MINUTES;
+ $this->setInterval(15 * 60);
$this->manager = $manager;
}
* Clean up all file locks that are expired for the DB file locking provider
*/
class CleanupFileLocks extends TimedJob {
- /**
- * Default interval in minutes
- *
- * @var int $defaultIntervalMin
- **/
- protected $defaultIntervalMin = 5;
-
/**
* sets the correct interval for this timed job
*/
public function __construct(ITimeFactory $time) {
parent::__construct($time);
-
- $this->interval = $this->defaultIntervalMin * 60;
+ $this->setInterval(5 * 60);
}
/**
use OCA\Files\Db\OpenLocalEditorMapper;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\TimedJob;
/**
// Run every 12h
$this->interval = 12 * 3600;
- $this->setTimeSensitivity(IJob::TIME_INSENSITIVE);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
/**
*/
class DeleteOrphanedItems extends TimedJob {
public const CHUNK_SIZE = 200;
- protected $defaultIntervalMin = 60;
/**
* sets the correct interval for this timed job
protected LoggerInterface $logger,
) {
parent::__construct($time);
- $this->interval = $this->defaultIntervalMin * 60;
+ $this->setInterval(60 * 60);
}
/**
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\Service\UserGlobalStoragesService;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\TimedJob;
use OCP\IUser;
use OCP\IUserManager;
// run every day
$this->setInterval(24 * 60 * 60);
- $this->setTimeSensitivity(IJob::TIME_INSENSITIVE);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
protected function run($argument) {
use OCA\FilesReminders\Service\ReminderService;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\TimedJob;
class CleanUpReminders extends TimedJob {
parent::__construct($time);
$this->setInterval(24 * 60 * 60); // 1 day
- $this->setTimeSensitivity(IJob::TIME_INSENSITIVE);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
/**
private LoggerInterface $logger,
) {
parent::__construct($time);
- $this->setInterval(86400);
+ $this->setInterval(24 * 60 * 60);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
public function run($argument) {
namespace OCA\Files_Sharing;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\TimedJob;
use OCP\IDBConnection;
use OCP\Share\Exceptions\ShareNotFound;
// Run once a day
$this->setInterval(24 * 60 * 60);
- $this->setTimeSensitivity(IJob::TIME_INSENSITIVE);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
* Send a reminder via email to the sharee(s) if the folder is still empty a predefined time before the expiration date
*/
class SharesReminderJob extends TimedJob {
- private const SECONDS_BEFORE_REMINDER = 86400;
+ private const SECONDS_BEFORE_REMINDER = 24 * 60 * 60;
private const CHUNK_SIZE = 1000;
private int $folderMimeTypeId;
IMimeTypeLoader $mimeTypeLoader,
) {
parent::__construct($time);
- $this->setInterval(3600);
+ $this->setInterval(60 * 60);
$this->folderMimeTypeId = $mimeTypeLoader->getId(ICacheEntry::DIRECTORY_MIMETYPE);
}
use OCA\OAuth2\Db\AccessTokenMapper;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\TimedJob;
use OCP\DB\Exception;
use Psr\Log\LoggerInterface;
parent::__construct($timeFactory);
// 30 days
$this->setInterval(60 * 60 * 24 * 30);
- $this->setTimeSensitivity(IJob::TIME_INSENSITIVE);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
/**
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Authentication\TwoFactorAuth\IRegistry;
-use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\TimedJob;
use OCP\IUserManager;
$this->jobList = $jobList;
$this->setInterval(60 * 60 * 24 * 14);
- $this->setTimeSensitivity(IJob::TIME_INSENSITIVE);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
protected function run($argument) {
parent::__construct($timeFactory);
// Run once a day
$this->setInterval(60 * 60 * 24);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
protected function run($argument) {
protected $limit;
/** @var int $defaultIntervalMin default interval in minutes */
- protected $defaultIntervalMin = 51;
+ protected $defaultIntervalMin = 60;
/** @var User_LDAP|User_Proxy $userBackend */
protected $userBackend;
$this->mapper = $mapper;
// Run every time the cron is run
- $this->setInterval(60);
+ $this->setInterval(0);
}
/**
) {
parent::__construct($time);
- $this->setInterval(3600);
+ $this->setInterval(60 * 60);
}
protected function run($argument): void {
) {
parent::__construct($time);
- $this->setTimeSensitivity(\OCP\BackgroundJob\IJob::TIME_INSENSITIVE);
- $this->setInterval(24 * 3600);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
+ $this->setInterval(24 * 60 * 60);
}
protected function run(mixed $argument): void {
bool $isCLI) {
parent::__construct($timeFactory);
// Run at most once an hour
- $this->setInterval(3600);
+ $this->setInterval(60 * 60);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
$this->connection = $connection;
$this->previewFolder = $previewFolder;
namespace OC\Security\Bruteforce;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\TimedJob;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
parent::__construct($time);
// Run once a day
- $this->setInterval(3600 * 24);
- $this->setTimeSensitivity(IJob::TIME_INSENSITIVE);
+ $this->setInterval(60 * 60 * 24);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
protected function run($argument): void {
use Psr\Log\LoggerInterface;
class RemoveOldTasksBackgroundJob extends TimedJob {
- public const MAX_TASK_AGE_SECONDS = 60 * 50 * 24 * 7 * 4; // 4 weeks
+ public const MAX_TASK_AGE_SECONDS = 60 * 60 * 24 * 7 * 4; // 4 weeks
private \OCP\Files\IAppData $appData;
public function __construct(
parent::__construct($timeFactory);
$this->setInterval(60 * 60 * 24);
// can be deferred to maintenance window
- $this->setTimeSensitivity(TimedJob::TIME_INSENSITIVE);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
$this->appData = $appDataFactory->get('core');
}
use Psr\Log\LoggerInterface;
class RemoveOldTasksBackgroundJob extends TimedJob {
- public const MAX_TASK_AGE_SECONDS = 60 * 50 * 24 * 7; // 1 week
+ public const MAX_TASK_AGE_SECONDS = 60 * 60 * 24 * 7; // 1 week
public function __construct(
ITimeFactory $timeFactory,
) {
parent::__construct($timeFactory);
$this->setInterval(60 * 60 * 24);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
/**
use Psr\Log\LoggerInterface;
class RemoveOldTasksBackgroundJob extends TimedJob {
- public const MAX_TASK_AGE_SECONDS = 60 * 50 * 24 * 7; // 1 week
+ public const MAX_TASK_AGE_SECONDS = 60 * 60 * 24 * 7; // 1 week
private IAppData $appData;
parent::__construct($timeFactory);
$this->appData = $appDataFactory->get('core');
$this->setInterval(60 * 60 * 24);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
/**
use OC\User\PartiallyDeletedUsersBackend;
use OC\User\User;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\TimedJob;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
private LoggerInterface $logger,
) {
parent::__construct($time);
- $this->setTimeSensitivity(IJob::TIME_INSENSITIVE);
- $this->setInterval(24 * 3600);
+ $this->setTimeSensitivity(self::TIME_INSENSITIVE);
+ $this->setInterval(24 * 60 * 60);
}
protected function run($argument): void {
* @since 24.0.0
*/
public function setTimeSensitivity(int $sensitivity): void {
- if ($sensitivity !== IJob::TIME_SENSITIVE &&
- $sensitivity !== IJob::TIME_INSENSITIVE) {
+ if ($sensitivity !== self::TIME_SENSITIVE &&
+ $sensitivity !== self::TIME_INSENSITIVE) {
throw new \InvalidArgumentException('Invalid sensitivity');
}