UNPKG

mm_os

Version:

MM_OS服务端架构,用于快速构建应用程序,支持网站建设、小程序后台、AI应用、物联网(IOT/AIOT)、游戏服务端等多种场景。

37 lines (36 loc) 845 B
/** * 定时任务函数 */ exports.main = async function main() { this.log('debug', '定时任务, 执行中...'); }; /** * 执行结果通知 * @param {string} name 任务名称 * @param {string} state 状态 */ exports.notify = async function(name, state) { switch (state) { case 'init': this.log('debug', '任务-初始化'); break; case 'start': this.log('debug', '任务-开始执行'); break; case 'stop': this.log('debug', '任务-已暂停'); break; case 'suspend': // 主动中断 this.log('debug', '任务-已中断'); break; case 'time_end': this.log('debug', '任务-已到期'); break; case 'completed': this.log('debug', '任务-已完成'); break; default: break; } };