ruff format
This commit is contained in:
parent
e7e8ec3bfd
commit
c51787c987
4 changed files with 11 additions and 6 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import redis
|
import redis
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
|
|
||||||
|
|
||||||
class RedisAdapter:
|
class RedisAdapter:
|
||||||
def __init__(self, host, port, lock_name):
|
def __init__(self, host, port, lock_name):
|
||||||
self.redis = redis.Redis(host=host, port=port)
|
self.redis = redis.Redis(host=host, port=port)
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import subprocess
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("=== Kuzu Subprocess Lock Test ===")
|
print("=== Kuzu Subprocess Lock Test ===")
|
||||||
print("Starting writer and reader in separate subprocesses...")
|
print("Starting writer and reader in separate subprocesses...")
|
||||||
|
|
@ -25,5 +26,6 @@ def main():
|
||||||
total_time = time.time() - start_time
|
total_time = time.time() - start_time
|
||||||
print(f"\nTotal execution time: {total_time:.2f}s")
|
print(f"\nTotal execution time: {total_time:.2f}s")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ def create_node(name):
|
||||||
)
|
)
|
||||||
return document
|
return document
|
||||||
|
|
||||||
|
|
||||||
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)]
|
nodes = [create_node(f"Node{i}") for i in range(200000)]
|
||||||
|
|
@ -28,5 +29,6 @@ async def main():
|
||||||
|
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
Loading…
Add table
Reference in a new issue