Created
October 22, 2016 14:31
-
-
Save n5i/2ffd22f6a5e2eaa0f615e66729900846 to your computer and use it in GitHub Desktop.
Delay with Neo4j plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Procedure("test.slowQuery") | |
public void slowQuery(@Name("delay") Number Delay ) throws InterruptedException | |
{ | |
long started = System.currentTimeMillis(); | |
while (System.currentTimeMillis() - started < Delay.intValue()) { | |
Thread.sleep(5); | |
if( transaction.getReasonIfTerminated() != null ){ | |
return; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment