use of com.orientechnologies.orient.core.schedule.OScheduledEventBuilder in project orientdb by orientechnologies.
the class DistributedSchedulerTest method eventByAPI.
private void eventByAPI() throws InterruptedException {
final ODatabaseDocumentTx db = new ODatabaseDocumentTx(getDatabaseURL(serverInstance.get(0)));
db.open("admin", "admin");
OFunction func = createFunction(db);
db.getMetadata().getScheduler().scheduleEvent(new OScheduledEventBuilder().setName("test").setRule("0/1 * * * * ?").setFunction(func).build());
Thread.sleep(5000);
Long count = getLogCounter(db);
Assert.assertTrue("count = " + count, count > 0);
db.getMetadata().getScheduler().removeEvent("test");
db.close();
}
Aggregations