MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / GraphContext_MarkWriter

Function GraphContext_MarkWriter

src/graph/graphcontext.c:208–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208void GraphContext_MarkWriter(RedisModuleCtx *ctx, GraphContext *gc) {
209 RedisModuleString *graphID = RedisModule_CreateString(ctx, gc->graph_name, strlen(gc->graph_name));
210
211 // Reopen only if key exists (do not re-create) make sure key still exists.
212 RedisModuleKey *key = RedisModule_OpenKey(ctx, graphID, REDISMODULE_READ);
213 if(RedisModule_KeyType(key) == REDISMODULE_KEYTYPE_EMPTY) goto cleanup;
214 RedisModule_CloseKey(key);
215
216 // Mark as writer.
217 key = RedisModule_OpenKey(ctx, graphID, REDISMODULE_WRITE);
218 RedisModule_CloseKey(key);
219
220cleanup:
221 RedisModule_FreeString(ctx, graphID);
222}
223
224void GraphContext_LockForCommit
225(

Callers 1

_ExecuteQueryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected