private static function runTask($command, $groupName)
    {
        $task = ExtensionDataHelper::buildTask($command, $groupName);
        if ($task->registerTask()) {
            DeferredHelper::runImmediateTask($task->model()->id);
            Yii::$app->response->format = Response::FORMAT_JSON;
            return [
                'queueItemId' => $task->model()->id,
            ];
        } else {
            throw new ServerErrorHttpException("Unable to start task");
        }
    }
private static function runTask($command, $groupName)
    {
        $task = ExtensionDataHelper::buildTask($command, $groupName);
        if ($task->registerTask()) {
            DeferredHelper::runImmediateTask($task->model()->id);
            Yii::$app->response->format = Response::FORMAT_JSON;
            return [
                'queueItemId' => $task->model()->id,
            ];
        } else {
            throw new ServerErrorHttpException("Unable to start task");
        }
    }
private static function runTask ( $ command , $ groupName ) { $ task = ExtensionDataHelper :: buildTask ( $ command , $ groupName ) ; if ( $ task -> registerTask ( ) ) { DeferredHelper :: runImmediateTask ( $ task -> model ( ) -> id ) ; Yii :: $ app -> response -> format = Response :: FORMAT_JSON ; return [ 'queueItemId' => $ task -> model ( ) -> id , ] ; } else { throw new ServerErrorHttpException ( "Unable to start task" ) ; } }
Runs separated ReportingTask

@param $command
@param $groupName
@return array
@throws ServerErrorHttpException
Runs separated ReportingTask