Skip to content

Instantly share code, notes, and snippets.

@n5i
Created October 22, 2016 14:31
Show Gist options
  • Save n5i/2ffd22f6a5e2eaa0f615e66729900846 to your computer and use it in GitHub Desktop.
Save n5i/2ffd22f6a5e2eaa0f615e66729900846 to your computer and use it in GitHub Desktop.
Delay with Neo4j plugin
@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