[Owncloud] Background Jobs
Jakob Sack
mail at jakobsack.de
Sun Aug 12 10:28:49 UTC 2012
Hi Jörn,
it is not an app but a feature in ownCloud core. Have a look at
lib/backgroundjob/* and lib/public/backgroundjobs.php!
Background jobs has yet another feature I did not mention: queued
tasks. You can add a new task by using OCP\BackgroundJobs::addQueuedJob(
$app, $class, $method, $parameters ). $app is the app name, $class and
$method are used to call the function, $parameters is some text you
might pass to your task.
The main problem with this solution is that you don't know when it will
be executed. It's not necessarily happening immediately as you might
know it from delayed jobs in rails where a daemon runs in background all
the time. In the worst case (using AJAX, all users offline) it could be
executed weeks later :-/
Regards,
Jakob
Am 12.08.2012 10:35, schrieb Jörn Friedrich Dreyer:
> Nice Work! Is it implemented as an app? Then the admin can deactivate
> background jobs by disabling the app, anyway.
>
> With regard to AJAX: what is our approach to various apps all
> wanting
> to make calls in the background. Possibly freezing the browser ui
> when
> using up all available connection (2 I think). Do we have some kind
> of
> queue for ajax calls? Should app authors always use the background
> jobs?
>
> So long
>
> Jörn
> --
> Jörn Friedrich Dreyer (jfd at owncloud.com)
> Software Developer
> ownCloud GmbH
>
> Your Data, Your Cloud, Your Way!
>
> ownCloud GmbH, GF: Markus Rex, Holger Dyroff
> Schloßäckerstrasse 26a, 90443 Nürnberg, HRB 28050 (AG Nürnberg)
>
> Jakob Sack <mail at jakobsack.de> schrieb:
>
>> I removed the option from the UI. In the program code the option
>> "none"
>> is still usable.
>>
>> Am 11.08.2012 23:08, schrieb Jan-Christoph Borchardt:
>>> Ah sorry, I phrased it wrong. I didn’t mean »just use AJAX all
>> the
>>> time and remove the option for cron jobs«, I meant »AJAX is
>> always
>>> available and has no negative effect, so let’s just not have an
>>> option
>>> to deactivate background jobs«.
>>> Of course if the server supports it, cron should be used.
>>>
>>>
>>> TL;DR: Nice, let’s remove the option to deactivate background
>> jobs.
More information about the Owncloud
mailing list