Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlashStore 会写满磁盘的问题 #155

Closed
wenh7788 opened this issue Feb 17, 2020 · 2 comments
Closed

FlashStore 会写满磁盘的问题 #155

wenh7788 opened this issue Feb 17, 2020 · 2 comments

Comments

@wenh7788
Copy link

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

@su-chang
Copy link
Member

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

@huan
Copy link
Member

huan commented Feb 17, 2020

A workaround code for [email protected]:

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.

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

No branches or pull requests

3 participants