graphaware / neo4j-expire

GraphAware Module for Expiring (Deleting) Nodes and Relationships
29 stars 10 forks source link

Trigger to set ttl with phase=before not being invoked #18

Closed ckazz closed 4 years ago

ckazz commented 4 years ago

Using:

neo4j 3.5.11
graphaware-expire-3.5.11.54.4.jar
graphaware-server-enterprise-all-3.5.11.54.jar

user is creating 2 triggers:

CALL apoc.trigger.add('create-ttl-new-pet','UNWIND {createdNodes} as n MATCH(n:Pet) set n.ttl=60000',{phase:'before'})
CALL apoc.trigger.add('create-ttl-new-person','UNWIND {createdNodes} as n MATCH(n:Person) set n.ttl=60000',{phase:'after'})

Trigger for label of Person with phase=before does not get triggered after the allotted time, but the one with phase=after does. Both nodes do display the "ttl": 60000, correctly.

Config file:

com.graphaware.runtime.enabled=true
com.graphaware.module.EM.1=com.graphaware.neo4j.expire.ExpirationModuleBootstrapper
#com.graphaware.module.EM.nodeExpirationProperty=expire
com.graphaware.module.EM.nodeTtlProperty=ttl
#com.graphaware.module.EM.relationshipExpirationProperty=expire
com.graphaware.module.EM.relationshipTtlProperty=ttl
com.graphaware.module.EM.nodeExpirationStrategy=force
#As with most GraphAware Modules, nodes and relationships this module applies to can be limited by the use of SPeL, e.g.:
#com.graphaware.module.EM.node=hasLabel('NodeThatExpiresAtSomePoint')
#com.graphaware.module.EM.relationship=isType('TEMPORARY_RELATIONSHIP')
com.graphaware.module.EM.maxExpirations=1000

Tried setting

com.graphaware.module.EM.node=hasLabel('Pet) || hasLabel('Person')

but the issue persists nonetheless. Any insight into this issue is greatly appreciated.

bachmanm commented 4 years ago

Could it be a typo in the setting? I.e. you should have

com.graphaware.module.EM.node=hasLabel('Pet') || hasLabel('Person')

instead of

com.graphaware.module.EM.node=hasLabel('Pet) || hasLabel('Person')

If it still doesn't work, could you email info@graphaware.com and tell us also how you're deploying Neo4j (Single mode? HA? Causal cluster?)

Thanks!

ckazz commented 4 years ago

Typo was in the way I entered for the github issue, neo4j.conf file is ok. I'll reach out via the email mentioned. Thanks.