简体   繁体   中英

how do I abort a query in py2neo?

I'm developing a web app that is basically a GUI to this Neo4j dataset we have here at my organization. The app is in Python (I'm using Flask+Tornado) and I'm using py2neo to connect to Neo4j. Things work fine, but sometimes a query will take too long to execute and it continues executing even if the user closes the tab or browser (or clicks that button that stops loading the page). So, how can I have the query aborted when the user closes the tab or browser or clicks the stop button?

Long running queries - For that you can set following 2 parameters in neo4j.properties: -

execution_guard_enabled=true
# it is milliseconds
org.neo4j.server.webserver.limit.executiontime=20000

As of now i do not see any option available in Py2neo to directly kill the request, except setting the HTTP timeouts in py2neo libs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM