Skip to content

Commit

Permalink
RedisPurger: implemented --rdb option
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Asmuth committed Feb 20, 2012
1 parent 0ba128e commit dfce80a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/RedisPurger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ void RedisPurger::setOption(char opt, char* value){
this->redisKeyMode = REDIS_KEYMODE_ZDEL;
this->redisKeyString = value;
break;

case OPT_RDB:
redisAsyncCommand(this->redis, NULL, NULL, "SELECT %s", value, strlen(value));
break;
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/fastpurge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

/*
FIXPAUL: --dry-run is working, but -d is not
FIXPAUL: --rdb=0 is not implemented yet
*/

void usage(const char* binary) {
Expand Down Expand Up @@ -93,6 +92,11 @@ int main(int argc, char* argv[]) {
adapter->setOption(OPT_ZDEL, optarg);
break;

case OPT_RDB:
for (const auto& adapter: adapters)
adapter->setOption(OPT_RDB, optarg);
break;

case 'v':
version();
return 0;
Expand Down

0 comments on commit dfce80a

Please sign in to comment.