public function __construct() {
parent::setInterval(60);
}
public function run($arguments) {
$this->myService->doCron($arguments['uid']);
notify();
}
public function notify() {
//Tried different things
}
}
I also defined this in info.xml
Why in document it is defined like that. Is it possible to use $this and static in the same method? public static function run($arguments) { $this->myService->doCron($arguments['uid']); }
When should constructor work? I tried it with XDebug, but I didn’t catch.
I found new entry for my app in database. As I understand, it never run before, but somehow appeared there.
MariaDB [nextcloud]> select id, class, argument, last_run, last_checked from oc_jobs where class like ‘%PollTask%’;
Why in document it is defined like that. Is it possible to use $this and static in the same method? public static function run($arguments) { $this->myService->doCron($arguments['uid']); }
If you need to be using the current instance of your class, you cannot use a static method, however just removing the static keyword should work then
When should constructor work? I tried it with XDebug, but I didn’t catch.
Depending on how you run the cron task, it might be that xdebug is not catching then because of your php configuration.
I found new entry for my app in database. As I understand, it never run before, but somehow appeared there.