簡體   English   中英

本地插件任務未顯示在 moodle 的計划任務列表中

[英]Local Plugin tasks are not showing up in the schedule tasks list in moodle

我做了一個本地插件。 它已安裝並顯示在插件下並創建了它的初始表等,但任務沒有出現在任務列表中。

$tasks = array(
    array(
        'classname' => 'tool_mobilechathelper\task\sync_chats',
        'blocking' => 0,
        'minute' => 0,
        'hour' => 22,
        'day' => '*',
        'dayofweek' => '*',
        'month' => '*'
    ),
);

在此處輸入圖像描述

以這種方式嘗試,時間值應該是字符串而不是數字。 它們必須匹配 unix cron 的語法,但阻塞應該保持不變。

$tasks = array(
    array(
        'classname' => 'tool_mobilechathelper\task\sync_chats',
        'blocking' => 0,
        'minute' => '0',
        'hour' => '22',
        'day' => '*',
        'dayofweek' => '*',
        'month' => '*'
    ),
);

另外,確保在你的任務 class 中有命名空間,

namespace tool_mobilechathelper\task;

並升級你的version.php ,然后運行php admin/cli/upgrade.php

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM