31 $DIC->backgroundTasks()->persistence()->saveBucketAndItsTasks($bucket);
33 $DIC->logger()->root()->info(
"[BT] Trying to call webserver");
36 $soap_client = new \ilSoapClient();
37 $soap_client->setResponseTimeout(1);
38 $soap_client->enableWSDL(
true);
40 $session_id = session_id();
43 $call = $soap_client->call(self::CMD_START_WORKER, array(
46 }
catch (\Throwable $t) {
47 $DIC->logger()->root()->info(
"[BT] Calling Webserver failed, fallback to sync version");
49 $sync_manager->run($bucket);
51 $DIC->logger()->root()->info(
"[BT] Calling webserver successful");
60 $n_of_tasks = $ilIliasIniFile->readVariable(
"background_tasks",
"number_of_concurrent_tasks");
61 $n_of_tasks = $n_of_tasks ? $n_of_tasks : 5;
63 $DIC->logger()->root()->info(
"[BackgroundTask] Starting background job.");
67 $MAX_PARALLEL_JOBS = $n_of_tasks;
69 $DIC->logger()->root()->info(
"[BT] Too many running jobs, worker going down.");
82 $task = $bucket->getTask();
87 $this->persistence->updateBucket($bucket);
90 $this->persistence->deleteBucket($bucket);
93 $this->persistence->saveBucketAndItsTasks($bucket);
96 $DIC->logger()->root()->info(
"[BT] Exception while async computing: " 98 $DIC->logger()->root()->info(
"[BT] Stack Trace: " 99 . $e->getTraceAsString());
103 $DIC->logger()->root()->info(
"[BT] One worker going down because there's nothing left to do.");
executeTask(Task $task, Observer $observer)
Actually executes a task.
Class PersistingObserver.
run(Bucket $bucket)
This will add an Observer of the Task and start running the task.