diff --git a/src/server.c b/src/server.c index d0e381ac9..9117245b8 100644 --- a/src/server.c +++ b/src/server.c @@ -1320,6 +1320,7 @@ void createSharedObjects(void) { shared.rpop = createStringObject("RPOP",4); shared.lpop = createStringObject("LPOP",4); shared.lpush = createStringObject("LPUSH",5); + shared.rpoplpush = createStringObject("RPOPLPUSH",9); for (j = 0; j < OBJ_SHARED_INTEGERS; j++) { shared.integers[j] = makeObjectShared(createObject(OBJ_STRING,(void*)(long)j)); diff --git a/src/server.h b/src/server.h index 7b0d22eaf..c0e2b9aaf 100644 --- a/src/server.h +++ b/src/server.h @@ -749,7 +749,7 @@ struct sharedObjectsStruct { *masterdownerr, *roslaveerr, *execaborterr, *noautherr, *noreplicaserr, *busykeyerr, *oomerr, *plus, *messagebulk, *pmessagebulk, *subscribebulk, *unsubscribebulk, *psubscribebulk, *punsubscribebulk, *del, *unlink, - *rpop, *lpop, *lpush, *emptyscan, + *rpop, *lpop, *lpush, *rpoplpush, *emptyscan, *select[PROTO_SHARED_SELECT_CMDS], *integers[OBJ_SHARED_INTEGERS], *mbulkhdr[OBJ_SHARED_BULKHDR_LEN], /* "*\r\n" */ diff --git a/src/t_list.c b/src/t_list.c index a0a30998d..6b3dc2b7c 100644 --- a/src/t_list.c +++ b/src/t_list.c @@ -596,6 +596,9 @@ void rpoplpushCommand(client *c) { signalModifiedKey(c->db,touchedkey); decrRefCount(touchedkey); server.dirty++; + if (c->cmd->proc == brpoplpushCommand) { + rewriteClientCommandVector(c,3,shared.rpoplpush,c->argv[1],c->argv[2]); + } } }