mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
Modules: no MULTI/EXEC for commands replicated from async contexts.
They are technically like commands executed from external clients one after the other, and do not constitute a single atomic entity.
This commit is contained in:
parent
09dd7b5ff0
commit
413c2bc180
@ -1163,7 +1163,12 @@ int RM_ReplyWithDouble(RedisModuleCtx *ctx, double d) {
|
||||
* in the context of a command execution. EXEC will be handled by the
|
||||
* RedisModuleCommandDispatcher() function. */
|
||||
void moduleReplicateMultiIfNeeded(RedisModuleCtx *ctx) {
|
||||
/* If we already emitted MULTI return ASAP. */
|
||||
if (ctx->flags & REDISMODULE_CTX_MULTI_EMITTED) return;
|
||||
/* If this is a thread safe context, we do not want to wrap commands
|
||||
* executed into MUTLI/EXEC, they are executed as single commands
|
||||
* from an external client in essence. */
|
||||
if (ctx->flags & REDISMODULE_CTX_THREAD_SAFE) return;
|
||||
execCommandPropagateMulti(ctx->client);
|
||||
ctx->flags |= REDISMODULE_CTX_MULTI_EMITTED;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user