Skip to content

Commit

Permalink
module set-augement implement
Browse files Browse the repository at this point in the history
Signed-off-by: hwware <[email protected]>
  • Loading branch information
hwware committed Aug 15, 2024
1 parent e4c288f commit 12b870f
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -13042,30 +13042,13 @@ int VM_RdbSave(ValkeyModuleCtx *ctx, ValkeyModuleRdbStream *stream, int flags) {
}

void updateModuleRunTimeArgument(struct ValkeyModule *module, void **argv, int argc) {
// moduleRunTimeEntryFree(module->runtime_entry);
struct moduleRunTimeEntry *runtime_entry;
int i;
runtime_entry = zmalloc(sizeof(struct moduleRunTimeEntry));
runtime_entry->argv = argc ? zmalloc(sizeof(robj *) * argc) : NULL;
for (i = 0; i < argc; i++) {
runtime_entry->argv[i] = createRawStringObject(argv[i], sdslen(argv[i]));
}
module->runtime_entry = runtime_entry;
/*
dictIterator *di = dictGetIterator(modules);
dictEntry *de;
int i;
while ((de = dictNext(di)) != NULL) {
struct ValkeyModule *valkey_module = dictGetVal(de);
moduleRunTimeEntryFree(valkey_module->runtime_entry);
struct moduleRunTimeEntry *runtime_entry;
runtime_entry = zmalloc(sizeof(struct moduleRunTimeEntry));
runtime_entry->argv = argc ? zmalloc(sizeof(robj *) * argc) : NULL;
for (i = 0; i < argc; i++) {
runtime_entry->argv[i] = createRawStringObject(argv[i], sdslen(argv[i]));
}
module->runtime_entry = zmalloc(sizeof(struct moduleRunTimeEntry));
module->runtime_entry->argv = argc ? zmalloc(sizeof(robj *) * argc) : NULL;
module->runtime_entry->argc = argc;
for (int i = 0; i < argc; i++) {
module->runtime_entry->argv[i] = argv[i];
incrRefCount(module->runtime_entry->argv[i]);
}
*/
}

/* MODULE command.
Expand Down

0 comments on commit 12b870f

Please sign in to comment.