MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rewriteModuleObject

Function rewriteModuleObject

app/redis-6.2.6/src/aof.c:1423–1434  ·  view source on GitHub ↗

Call the module type callback in order to rewrite a data type * that is exported by a module and is not handled by Redis itself. * The function returns 0 on error, 1 on success. */

Source from the content-addressed store, hash-verified

1421 * that is exported by a module and is not handled by Redis itself.
1422 * The function returns 0 on error, 1 on success. */
1423int rewriteModuleObject(rio *r, robj *key, robj *o) {
1424 RedisModuleIO io;
1425 moduleValue *mv = o->ptr;
1426 moduleType *mt = mv->type;
1427 moduleInitIOContext(io,mt,r,key);
1428 mt->aof_rewrite(&io,key,mv->value);
1429 if (io.ctx) {
1430 moduleFreeContext(io.ctx);
1431 zfree(io.ctx);
1432 }
1433 return io.error ? 0 : 1;
1434}
1435
1436/* This function is called by the child rewriting the AOF file to read
1437 * the difference accumulated from the parent into a buffer, that is

Callers 1

rewriteAppendOnlyFileRioFunction · 0.85

Calls 2

moduleFreeContextFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected