Used inside commands to schedule the propagation of additional commands * after the current command is propagated to AOF / Replication. * * 'cmd' must be a pointer to the Redis command to replicate, dbid is the * database ID the command should be propagated into. * Arguments of the command to propagate are passed as an array of redis * objects pointers of len 'argc', using the 'argv' vector.
| 4400 | * stack allocated). The function automatically increments ref count of |
| 4401 | * passed objects, so the caller does not need to. */ |
| 4402 | void alsoPropagate(struct redisCommand *cmd, int dbid, robj **argv, int argc, |
| 4403 | int target) |
| 4404 | { |
| 4405 | robj **argvcopy; |
| 4406 | int j; |
| 4407 | |
| 4408 | if (g_pserver->loading) return; /* No propagation during loading. */ |
| 4409 | |
| 4410 | argvcopy = (robj**)zmalloc(sizeof(robj*)*argc, MALLOC_LOCAL); |
| 4411 | for (j = 0; j < argc; j++) { |
| 4412 | argvcopy[j] = argv[j]; |
| 4413 | incrRefCount(argv[j]); |
| 4414 | } |
| 4415 | redisOpArrayAppend(&g_pserver->also_propagate,cmd,dbid,argvcopy,argc,target); |
| 4416 | } |
| 4417 | |
| 4418 | /* It is possible to call the function forceCommandPropagation() inside a |
| 4419 | * Redis command implementation in order to to force the propagation of a |
no test coverage detected