-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
enhancementstaleTicket or PR with no recent activityTicket or PR with no recent activitytechnical debt
Milestone
Description
The public background job API is afaik used by specifying this in your info.xml
<background-jobs>
<job>OCA\News\Cron\Updater</job>
</background-jobs>Then the specified class has to implement this interface https://github.com/nextcloud/server/blob/master/lib/public/BackgroundJob/IJob.php
As you may have noticed the public interface is absolutely unusable, that's why there is https://github.com/nextcloud/server/blob/master/lib/private/BackgroundJob/Job.php
Anyone who wants to implement something using the cronjob API however has to duplicate your code because the class lives in the private namespace. Would it be possible to give us mortal app devs access to a saner interface which works with DI :D?
interface IBackgroundJob {
function run();
}That can be used like this?
class Updater implements OCP\BackgroundJob\IBackgroundJob {
public function __construct(UpdateService $updater) {
$this->updater = $updater;
}
public function run() {
$this->updater->updateFeeds();
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementstaleTicket or PR with no recent activityTicket or PR with no recent activitytechnical debt