Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py2neo运行同样的程序, 静止一段时间后再调用,时间变长 #961

Open
kaiyangtongxue opened this issue Aug 31, 2023 · 1 comment

Comments

@kaiyangtongxue
Copy link

py2neo运行同样的程序, 静止一段时间后再调用,时间变长。运行时间间隔少于10s则不会出现问题。py2neo 2021.2

@ljluestc
Copy link

ljluestc commented Mar 2, 2025

from py2neo import Graph, Database

# Initialize the Graph object with connection pool settings
graph = Graph("bolt://localhost:7687", auth=("neo4j", "password"), max_connections=10)

def run_query():
    # Run your Cypher query
    result = graph.run("MATCH (n) RETURN n LIMIT 10")
    for record in result:
        print(record)

# Example usage
if __name__ == "__main__":
    # Run the query multiple times to test performance
    for _ in range(5):
        run_query()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants