Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

建议给AutoSavePluginConfig添加一个实时写出的选择 #408

Closed
asforest opened this issue Sep 17, 2021 · 2 comments · Fixed by #420
Closed

建议给AutoSavePluginConfig添加一个实时写出的选择 #408

asforest opened this issue Sep 17, 2021 · 2 comments · Fixed by #420
Milestone

Comments

@asforest
Copy link

asforest commented Sep 17, 2021

建议给AutoSavePluginConfig添加一个实时写出的选择,因为开发调试插件时数据变动非常频繁,而对应的配置文件又不会实时变过来,调试起来怪麻烦的,我只得自己用FileInputStream另外实现一套实时写出的方案。

可能有时候读写配置文件的性能开销不那么重要,建议添加参数来让开发者选择是否实时写出配置文件,或者显式调用对应的方法手动写出也可以

已解决:
根据文档中的描述,AutoSavePluginConfig会在后台利用协程定时保存数据。

但是有些小问题/小建议我想要说一下,如果修改数据后立即使用/stop关闭mirai-console,数据会无法保存,会导致刚刚修改的内容丢失,建议在关闭时等一下协程,保存好数据以后再继续关闭流程

@cssxsh
Copy link
Contributor

cssxsh commented Sep 26, 2021

修改数据后立即使用/stop关闭mirai-console,数据会无法保存

会这样吗?
感觉是数据修改没有写入

@asforest
Copy link
Author

修改数据后立即使用/stop关闭mirai-console,数据会无法保存

会这样吗?
感觉是数据修改没有写入

我重新验证了一遍,发现没有这个问题,可能的确是我之前代码的问题,这个问题上是我的锅

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants