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.
| 3610 | * stack allocated). The function automatically increments ref count of |
| 3611 | * passed objects, so the caller does not need to. */ |
| 3612 | void alsoPropagate(struct redisCommand *cmd, int dbid, robj **argv, int argc, |
| 3613 | int target) |
| 3614 | { |
| 3615 | robj **argvcopy; |
| 3616 | int j; |
| 3617 | |
| 3618 | if (server.loading) return; /* No propagation during loading. */ |
| 3619 | |
| 3620 | argvcopy = zmalloc(sizeof(robj*)*argc); |
| 3621 | for (j = 0; j < argc; j++) { |
| 3622 | argvcopy[j] = argv[j]; |
| 3623 | incrRefCount(argv[j]); |
| 3624 | } |
| 3625 | redisOpArrayAppend(&server.also_propagate,cmd,dbid,argvcopy,argc,target); |
| 3626 | } |
| 3627 | |
| 3628 | /* It is possible to call the function forceCommandPropagation() inside a |
| 3629 | * Redis command implementation in order to to force the propagation of a |
no test coverage detected