apoc icon indicating copy to clipboard operation
apoc copied to clipboard

Add method to obtain periodic job code

Open neo-technology-build-agent opened this issue 2 years ago • 1 comments

Issue by orthogonal3 Wednesday Nov 10, 2021 at 17:23 GMT Originally opened as https://github.com/neo4j-contrib/neo4j-apoc-procedures/issues/2323


Background

Periodic jobs can be scheduled with apoc.periodic.repeat().

Once the job is scheduled, it can be found with apoc.periodic.list()

CALL apoc.periodic.list()
╒════════════╤═══════╤══════╤══════╤═══════════╕
│"name"      │"delay"│"rate"│"done"│"cancelled"│
╞════════════╪═══════╪══════╪══════╪═══════════╡
│"test-jobid"│0      │60    │false │false      │
└────────────┴───────┴──────┴──────┴───────────┘

But other than the the name field of the job, there's no way to view what the job does to confirm it is a specific job that needs cancelling.

Suggested Feature

One option would be to add an apoc.periodic.describe() function that returns the details of the scheduled job, including the Cypher statement:

apoc.periodic.describe(name :: STRING?) :: (name :: STRING?, statement :: STRING?, rate :: INTEGER?, config = {} :: MAP?)

Or, add an option to apoc.periodic.list procedure, like apoc.periodic.list(verbose :: BOOLEAN?) to provide further detail?