Skip to content

Fix store.cleanSnapshots for redis implementation#127

Merged
adrai merged 2 commits intothenativeweb:masterfrom
shyftpower:issue-126-redis-fix
Apr 30, 2018
Merged

Fix store.cleanSnapshots for redis implementation#127
adrai merged 2 commits intothenativeweb:masterfrom
shyftpower:issue-126-redis-fix

Conversation

@TyGuy
Copy link
Copy Markdown
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