Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 1fd60a5

Browse files
committed
Sets a default provider for TaskService otherwise top-level errors of command line are not visible to task status.
1 parent 89612bd commit 1fd60a5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/src/plugins/core.tasks/src/TaskService.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use Pydio\Core\Utils\Vars\StringHelper;
3737

3838
use Pydio\Log\Core\Logger;
39+
use Pydio\Tasks\Providers\SqlTasksProvider;
3940

4041
defined('AJXP_EXEC') or die('Access not allowed');
4142

@@ -68,6 +69,8 @@ public function setProvider(ITasksProvider $provider){
6869
public static function getInstance(){
6970
if(!isSet(self::$instance)){
7071
self::$instance = new TaskService();
72+
// Sets a default provider!
73+
self::$instance->setProvider(new SqlTasksProvider());
7174
}
7275
return self::$instance;
7376
}
@@ -183,7 +186,7 @@ public static function actionAsTask(ContextInterface $ctx, $actionName, $paramet
183186
* @throws PydioException
184187
*/
185188
public function updateTaskStatus($taskId, $status, $message, $stoppable = null, $progress = null){
186-
$t = self::getTaskById($taskId);
189+
$t = $this->getTaskById($taskId);
187190
if(empty($t)){
188191
throw new PydioException("Cannot find task with this id");
189192
}
@@ -198,7 +201,7 @@ public function updateTaskStatus($taskId, $status, $message, $stoppable = null,
198201
if($progress !== null){
199202
$t->setProgress($progress);
200203
}
201-
return self::updateTask($t);
204+
return $this->updateTask($t);
202205
}
203206

204207
/**

0 commit comments

Comments
 (0)