Skip to content

We should use FlashStore insteadof FlashStoreSync #102

@huan

Description

@huan

In our code, we are using FlashStoreSync:

https://github.com/padlocal/wechaty-puppet-padlocal/blob/a4b04b723fc4f75d08596a2952e08f4b5037983c/src/padlocal/cache-manager.ts#L7

the FlashStoreSync will provide a sync API with the cost of ... load all data in memory, which is not very efficient for memory usage.

I'd like to suggest that we should replace the FlashStoreSync with the FlashStore and using its async API. (with the latest version, with LevelDB backend).

Best practice

The wechaty-puppet-service module can shows the best practice for using FlashStore:

https://github.com/wechaty/wechaty-puppet-service/blob/main/src/client/payload-store.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions