2023-10-21 10:16:24 1006次浏览 1条回答 0 悬赏 10 金钱

命令行执行:

/app/yii schedule/run --scheduleFile=@console/config/schedule.php

报错信息:

Unknown command: schedule/run
Caused by: Exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "schedule/run".'

yii2 advanced

/console/config/schedule.php 内容

<?php
use omnilight\scheduling\Schedule;

/**
 * @var Schedule $schedule
 */
$commandBathPath = Yii::getAlias('@app') . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'yii ';
if(YII_ENV_PROD) {
    $schedule->exec($commandBathPath . 'spider/process-email-pic')->everyTenMinutes();
    $schedule->exec($commandBathPath . 'email/send-from-queue')->everyNMinutes(2);
}
  • 回答于 2023-10-24 12:00 举报

    明显是 omnilight/yii2-scheduling 这个东西的安装有问题
    或者是 根本就没装?

您需要登录后才可以回答。登录 | 立即注册
acai2046
试用期

acai2046

注册时间:2016-12-17
最后登录:2024-02-29
在线时长:4小时38分
  • 粉丝0
  • 金钱0
  • 威望0
  • 积分40

热门问题