Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-17-2020 05:06 AM
Hello,
I didnt find anything about that, so...
I want to aggregate a value inside the database each Xmin, is it possible to do a job like a crontab directly on database or should I create that cypher on my application?
Tks for the help
06-17-2020 06:10 AM
To my knowledge there's not a built in "task scheduler" in Neo4j. You can use existing scheduling programs like crontab to execute a script on a schedule.
Another idea is you could change it not to be time driven but event driven instead. You could have a database trigger to update aggregates when data changes. Or you could use the Kafka integration to publish an event that data has changed that would then start the process to come back down to update aggregates. Benefit of event driven workflow is you're not wasting compute cycles recalculating aggregates if nothing has changed since the last time.
07-23-2020 01:19 AM
You can use APOC to schedule background jobs.
If you would like to run a query periodically, then you can use this procedure:
apoc.periodic.repeat
More info:
call apoc.help("periodic")
N.B.: The documentation says there is a apoc.periodic.schedule, but it is wrong, it is the repeat procedure:
https://neo4j.com/docs/labs/apoc/4.1/background-operations/background-jobs/
All the sessions of the conference are now available online