Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* fix bug: add param cb to exec/flush

  • Loading branch information...
commit 5340501fe6548aaa4bf612e44681c615a165f5f9 1 parent c71eb95
palmtoy authored
Showing with 6 additions and 5 deletions.
  1. +3 −2 lib/commands/server.js
  2. +3 −3 lib/rewriter/rewriter.js
View
5 lib/commands/server.js
@@ -32,8 +32,9 @@
this.enqueue(arguments[0],arguments[1]);
break;
case 3:
+ case 4:
mergerKey = [arguments[0],arguments[1]].join('');
- this.mergerMap[mergerKey] = {key:arguments[0],val:clone(arguments[2])};
+ this.mergerMap[mergerKey] = {key: arguments[0], val: clone(arguments[2]), cb: arguments[3]};
this.writeToAOF(arguments[0], [arguments[2]]);
break;
default:
@@ -96,7 +97,7 @@
delete this.mergerMap[mergerKey];
}
this.writeToAOF(arguments[0], [arguments[2]]);
- return this.rewriter.flush(arguments[0],arguments[2]);
+ return this.rewriter.flush(arguments[0], arguments[2], arguments[3]);
} else {
this.log.error('invaild arguments,flush must have at least 3 arguments');
return false;
View
6 lib/rewriter/rewriter.js
@@ -26,7 +26,7 @@
var mergerMap = server.mergerMap;
for (var mergerKey in mergerMap){
var entry = mergerMap[mergerKey];
- self.tick(entry.key,entry.val);
+ self.tick(entry.key, entry.val, entry.cb);
delete mergerMap[mergerKey];
}
return true;
@@ -37,8 +37,8 @@
* flush db
*
*/
- Rewriter.prototype.flush = function(key,val){
- this.tick(key,val);
+ Rewriter.prototype.flush = function(key, val, cb){
+ this.tick(key, val, cb);
};
/*
*
Please sign in to comment.
Something went wrong with that request. Please try again.