diff --git a/redis-cli.c b/redis-cli.c index ce8dbde8..279bf10c 100644 --- a/redis-cli.c +++ b/redis-cli.c @@ -175,6 +175,8 @@ static struct redisCommand cmdTable[] = { {"psubscribe",-2,CMDFLAG_NONE}, {"punsubscribe",-1,CMDFLAG_NONE}, {"publish",3,CMDFLAG_NONE}, + {"watch",-2,CMDFLAG_NONE}, + {"unwatch",1,CMDFLAG_NONE}, {NULL,0,CMDFLAG_NONE} }; diff --git a/redis.c b/redis.c index b6900d0d..08fcd978 100644 --- a/redis.c +++ b/redis.c @@ -2743,6 +2743,7 @@ static redisClient *createClient(int fd) { c->blocking_keys = NULL; c->blocking_keys_num = 0; c->io_keys = listCreate(); + c->watched_keys = listCreate(); listSetFreeMethod(c->io_keys,decrRefCount); c->pubsub_channels = dictCreate(&setDictType,NULL); c->pubsub_patterns = listCreate(); diff --git a/staticsymbols.h b/staticsymbols.h index 30c4d779..b3ff3db4 100644 --- a/staticsymbols.h +++ b/staticsymbols.h @@ -289,6 +289,7 @@ static struct redisFunctionSym symsTable[] = { {"syncReadLine",(unsigned long)syncReadLine}, {"syncWithMaster",(unsigned long)syncWithMaster}, {"syncWrite",(unsigned long)syncWrite}, +{"touchWatchedKey",(unsigned long)touchWatchedKey}, {"tryFreeOneObjectFromFreelist",(unsigned long)tryFreeOneObjectFromFreelist}, {"tryObjectEncoding",(unsigned long)tryObjectEncoding}, {"tryResizeHashTables",(unsigned long)tryResizeHashTables}, @@ -297,6 +298,8 @@ static struct redisFunctionSym symsTable[] = { {"unblockClientWaitingData",(unsigned long)unblockClientWaitingData}, {"unlockThreadedIO",(unsigned long)unlockThreadedIO}, {"unsubscribeCommand",(unsigned long)unsubscribeCommand}, +{"unwatchAllKeys",(unsigned long)unwatchAllKeys}, +{"unwatchCommand",(unsigned long)unwatchCommand}, {"updateDictResizePolicy",(unsigned long)updateDictResizePolicy}, {"updateSlavesWaitingBgsave",(unsigned long)updateSlavesWaitingBgsave}, {"usage",(unsigned long)usage}, @@ -325,6 +328,8 @@ static struct redisFunctionSym symsTable[] = { {"waitEmptyIOJobsQueue",(unsigned long)waitEmptyIOJobsQueue}, {"waitForMultipleSwappedKeys",(unsigned long)waitForMultipleSwappedKeys}, {"waitForSwappedKey",(unsigned long)waitForSwappedKey}, +{"watchCommand",(unsigned long)watchCommand}, +{"watchForKey",(unsigned long)watchForKey}, {"xorDigest",(unsigned long)xorDigest}, {"xorObjectDigest",(unsigned long)xorObjectDigest}, {"yesnotoi",(unsigned long)yesnotoi},