* 重新运行模块 * * @param moduleName 模块名称 * @param args `run()` 方法参数
(moduleName: string, ...args: any[])
| 275 | * @param args `run()` 方法参数 |
| 276 | */ |
| 277 | function rerunModule(moduleName: string, ...args: any[]): Promise<void> | void { |
| 278 | const moduleInstance = moduleInstances[moduleName] |
| 279 | |
| 280 | if (moduleInstance) { |
| 281 | clearTimeout(moduleInstance.nextRunTimer) |
| 282 | return moduleInstance.run(...args) |
| 283 | } else { |
| 284 | throw new ModuleError('ModuleStore', `模块 ${moduleName} 不存在`) |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | // 监听模块配置信息的变化,使用防抖降低油猴写配置信息频率 |
| 289 | watch( |