Closed Nambers closed 2 years ago
@Him188 这样子吗,需不需要直接写在onEnable()里而不是现在的lazy里 目前就cancel后还要等onEnable()执行完才close console
如果在lazy里:
如果在onEnable()里:
应该要写在 PluginManager 在获取到所有插件 Plugin 实例后进行
应该要写在 PluginManager 在获取到所有插件 Plugin 实例后进行
在 BultInJvmPluginLoaderImpl
的 load
里面写会不会更好
因为 PluginManager
里面都是 Plugin
类型,设计上看起来是不管内部,而 dataFolder
是在 JvmPlugin
里有
@Nambers Indeed.
- Tested?
- 消息过于密集,适当添加换行 (使用两次 logger)
- (仅建议) 可以考虑输出的路径为相对于 console 运行目录的路径 (caused by 2.)
如果目标文件夹下没有任何文件(listFiles().size == 0
),使用rename会返回false不抛出任何异常
这样的话是要删除目标文件夹然后移动,还是发出log让用户手动移动?
建议添加单元测试, 见 CommandTest 查看如何在 test 启动 console
建议添加单元测试, 见 CommandTest 查看如何在 test 启动 console
差点忘了name == id的情况了, 为什么这个test每个单个执行就可以pass, 但是我整个类一起执行就会报错 kotlinx.coroutines.JobCancellationException: Job was cancelled;
问题在MiraiConsole.cancell
因为 test 框架可能有 bug
因为 test 框架可能有 bug
对协程的这方面不是很熟悉,目前没找到什么方法解决这个问题,在本地这个test是可以pass的 你们看看怎么写? 看Coroutine context是supervisor job 应该没什么问题可能
尝试修了下,没找到解决方法 :( 大概要注意的地方有
@afterEach
的cancel会报错, 这个应该是就用目前这个cancelOnFinish
控制但是这些问题对于正常使用是没有问题的,因为正常设计下cancel了MiraiConsole就退出了(
试试 rebase 到 master 然后换用新的 AbstractConsoleTest.kt?
看了一下, 问题是现在 Console 的很多服务都是静态的, 没法重启, 得等 https://github.com/Him188/kotlin-dynamic-delegation
close #276