FlashStore 会写满磁盘的问题
wenh7788 opened this issue · comments
wenh7788 commented
挂的微信号联系人(通讯录)有421人
微信号所在的群大概有100多个,每个群的群成员平均有200多个
我们的服务器的硬盘是10G,运行一段时间我们的服务器会报警,写满磁盘
SuperChang commented
Thanks for your issue, we will fix this bug in next latest version.
Huan Li commented
A workaround code for FlashStore@0.18:
async function compact (store: FlashStore): Promise<void> {
await store.size
const db = (store as any).levelDb.db.db.db
await new Promise((resolve, reject) => {
db.compact((err: any) => {
if (err) {
return reject(err)
}
resolve()
})
})
}
Run compact(store)
on a FlashStore instance to runs a compaction process on the database files.
Reduces the size of data on disk. Deletes old log entries.