Changes reader writer example to test redis lock
This commit is contained in:
parent
2848b03bcc
commit
ce4a55a474
2 changed files with 4 additions and 5 deletions
|
|
@ -6,9 +6,7 @@ from cognee.infrastructure.databases.graph.kuzu.adapter import KuzuAdapter
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
print("Reader: Waiting 2 seconds...")
|
time.sleep(20)
|
||||||
|
|
||||||
time.sleep(5)
|
|
||||||
adapter = KuzuAdapter("test.db")
|
adapter = KuzuAdapter("test.db")
|
||||||
result = await adapter.query("MATCH (n:Node) RETURN COUNT(n)")
|
result = await adapter.query("MATCH (n:Node) RETURN COUNT(n)")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,14 @@ def create_node(name):
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
adapter = KuzuAdapter("test.db")
|
adapter = KuzuAdapter("test.db")
|
||||||
|
nodes = [create_node(f"Node{i}") for i in range(200000)]
|
||||||
|
|
||||||
print("Writer: Starting...")
|
print("Writer: Starting...")
|
||||||
nodes = [create_node(f"Node{i}") for i in range(100)]
|
|
||||||
await adapter.add_nodes(nodes)
|
await adapter.add_nodes(nodes)
|
||||||
|
|
||||||
print("writer finished...")
|
print("writer finished...")
|
||||||
|
|
||||||
time.sleep(100)
|
time.sleep(10)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
Loading…
Add table
Reference in a new issue