From 4ad5b11ffde10ccffb4c956ebf0850966d4151c7 Mon Sep 17 00:00:00 2001 From: nienzu Date: Wed, 28 Oct 2020 16:31:11 +0800 Subject: [PATCH] Correct sample code dependency and some typo Signed-off-by: nienzu --- developer_manual/basics/backgroundjobs.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/developer_manual/basics/backgroundjobs.rst b/developer_manual/basics/backgroundjobs.rst index c72669226..0dd1150e9 100644 --- a/developer_manual/basics/backgroundjobs.rst +++ b/developer_manual/basics/backgroundjobs.rst @@ -10,7 +10,7 @@ jobs in Nextcloud that send out the activity emails. Or expire the trashbin. Types of background jobs ------------------------ Nextcloud by default offers you two types of background jobs. The ``\OCP\BackgroundJob\QueuedJob`` -and ```\OCP\BackgroundJob\TimedJob``. +and ``\OCP\BackgroundJob\TimedJob``. The ``QueuedJob`` is for one time jobs. This can for example be triggered by inserting a job because an event happened. The ``TimedJob`` has a method ``setInterval`` where @@ -32,6 +32,7 @@ your job class of choice. use \OCA\MyApp\Service\SomeService; use \OCP\BackgroundJob\TimedJob; + use \OCP\AppFramework\Utility\ITimeFactory; class SomeTask extends TimedJob { @@ -101,6 +102,7 @@ For example you could add or remove a certain job based on some controller: use \OCA\MyApp\Cron\SomeTask; use \OCP\AppFramework\Controller; use \OCP\BackgroundJob\IJobList; + use \OCP\IRequest; class SomeController extends Controller {