mirror of https://mirror.osredm.com/root/redis.git
VSIM thread: manipulate results while still locked.
This commit is contained in:
parent
f70dc8acb2
commit
3d31fc3bee
4
vset.c
4
vset.c
|
@ -706,8 +706,6 @@ void VSIM_execute(RedisModuleCtx *ctx, struct vsetObject *vset,
|
||||||
filter_expr, filter_ef);
|
filter_expr, filter_ef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hnsw_release_read_slot(vset->hnsw,slot);
|
|
||||||
RedisModule_Free(vec);
|
|
||||||
|
|
||||||
/* Return results */
|
/* Return results */
|
||||||
if (withscores)
|
if (withscores)
|
||||||
|
@ -726,12 +724,14 @@ void VSIM_execute(RedisModuleCtx *ctx, struct vsetObject *vset,
|
||||||
RedisModule_ReplyWithDouble(ctx, 1.0 - distances[i]/2.0);
|
RedisModule_ReplyWithDouble(ctx, 1.0 - distances[i]/2.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hnsw_release_read_slot(vset->hnsw,slot);
|
||||||
|
|
||||||
if (withscores)
|
if (withscores)
|
||||||
RedisModule_ReplySetMapLength(ctx, arraylen);
|
RedisModule_ReplySetMapLength(ctx, arraylen);
|
||||||
else
|
else
|
||||||
RedisModule_ReplySetArrayLength(ctx, arraylen);
|
RedisModule_ReplySetArrayLength(ctx, arraylen);
|
||||||
|
|
||||||
|
RedisModule_Free(vec);
|
||||||
RedisModule_Free(neighbors);
|
RedisModule_Free(neighbors);
|
||||||
RedisModule_Free(distances);
|
RedisModule_Free(distances);
|
||||||
if (filter_expr) exprFree(filter_expr);
|
if (filter_expr) exprFree(filter_expr);
|
||||||
|
|
Loading…
Reference in New Issue