wechaty / wechaty-puppet-padplus

DEPRECATED: One puppet based on iPad protocal for Wechaty

Home Page:https://wechaty.js.org/docs/puppet-services/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FlashStore 会写满磁盘的问题

wenh7788 opened this issue · comments

挂的微信号联系人(通讯录)有421人
微信号所在的群大概有100多个,每个群的群成员平均有200多个
我们的服务器的硬盘是10G,运行一段时间我们的服务器会报警,写满磁盘

Thanks for your issue, we will fix this bug in next latest version.

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.