29 $DIC->backgroundTasks()->persistence()->saveBucketAndItsTasks($bucket);
31 $DIC->logger()->root()->info(
"[BackgroundTasks] Trying to call webserver");
34 $soap_client = new \ilSoapClient();
35 $soap_client->setResponseTimeout(0);
36 $soap_client->enableWSDL(
true);
38 $session_id = session_id();
39 $ilClientId =
$_COOKIE[
'ilClientId'];
40 $call = $soap_client->call(self::CMD_START_WORKER,
array(
41 $session_id .
'::' . $ilClientId,
43 $DIC->logger()->root()->info(var_export($call,
true));
53 $n_of_tasks = $ilIliasIniFile->readVariable(
"background_tasks",
"number_of_concurrent_tasks");
54 $n_of_tasks = $n_of_tasks ? $n_of_tasks : 5;
56 $DIC->logger()->root()->info(
"[BackgroundTask] Starting background job.");
60 $MAX_PARALLEL_JOBS = $n_of_tasks;
62 $DIC->logger()->root()->info(
"[BackgroundTask] Too many running jobs, worker going down.");
75 $task = $bucket->getTask();
80 $this->persistence->updateBucket($bucket);
83 $this->persistence->saveBucketAndItsTasks($bucket);
86 $DIC->logger()->root()->info(
"[BackgroundTasks] Exception while async computing: " 88 $DIC->logger()->root()->info(
"[BackgroundTasks] Stack Trace: " 89 . $e->getTraceAsString());
93 $DIC->logger()->root()->info(
"[BackgroundTasks] One worker going down because there's nothing left to do.");
executeTask(Task $task, Observer $observer)
Actually executes a task.
Class PersistingObserver.
Create styles array
The data for the language used.
run(Bucket $bucket)
This will add an Observer of the Task and start running the task.