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

Fix store.cleanSnapshots for redis implementation #127

Merged
merged 2 commits into from
Apr 30, 2018

Conversation

TyGuy
Copy link
Contributor

@TyGuy TyGuy commented Apr 30, 2018

Before

If you have an EventStore instance of type redis including a non-zero maxSnapshotsCount (for example, maxSnapshotsCount: 5),
When you have fewer than 5 snapshots (i.e. 0), and you call something like:

es.createSnapshot(snap, (err) => {
    if (err) { console.log(err); /*handle err*/ }
    // ...etc.
})

Then you will see this error:

ReplyError: ERR wrong number of arguments for 'del' command
/app/node_modules/redis-parser/lib/parser.js in parseError at line 193:12

(NOTE: the snapshot does get created correctly, but then the return value errors because cleanSnapshots fails).

Now

You can call es.createSnapshot(snap, cb) without the error from cleanSnapshots.

@adrai hope this is helpful, and let me know if you see any changes you'd like made. Thanks.

(Fixes #126)

@adrai adrai merged commit 5b84be5 into thenativeweb:master Apr 30, 2018
@TyGuy TyGuy deleted the issue-126-redis-fix branch April 30, 2018 21:08
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

Successfully merging this pull request may close these issues.

2 participants