-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
(#778) perf: add checking and loading scripts uniqueness in pipeline #781
Conversation
lib/pipeline.js
Outdated
@@ -268,6 +268,8 @@ Pipeline.prototype.exec = function (callback) { | |||
|
|||
return this.redis.script('exists', scripts.map(function (item) { | |||
return item.sha; | |||
}).filter(function (sha, index, shaList) { | |||
return shaList.indexOf(sha) === index; | |||
})).then(function (results) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scripts.map(function (item) {
return item.sha;
}).filter(function (sha, index, shaList) {
return shaList.indexOf(sha) === index;
})
Would be better to change to
Array.from(new Set(scripts.map(({sha}) => sha)))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
test/functional/pipeline.js
Outdated
@@ -12,7 +12,7 @@ describe('pipeline', function () { | |||
[null, 3], | |||
[null, '3'] | |||
]); | |||
redis.disconnect() | |||
redis.disconnect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't add ;
here. Code style changes should belong to a separate pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
## [4.5.1](v4.5.0...v4.5.1) (2019-01-13) ### Performance Improvements * add checking and loading scripts uniqueness in pipeline ([#781](#781)) ([66075ba](66075ba))
🎉 This PR is included in version 4.5.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [4.5.1](redis/ioredis@v4.5.0...v4.5.1) (2019-01-13) ### Performance Improvements * add checking and loading scripts uniqueness in pipeline ([#781](redis/ioredis#781)) ([66075ba](redis/ioredis@66075ba))
#778