ttreeagency / Scheduler

A basic tasks scheduler inspired by cron for your Flow Framework and Neos project.
21 stars 13 forks source link

Cron annotation breaks neos cache #24

Closed markuspfeifenberger closed 5 years ago

markuspfeifenberger commented 6 years ago

When the following Annotation is used

/**
 * @Scheduler\Schedule(expression="*\/5 * * * *")
 */

the flow task:list displays the correct Interval value */5 * * * *

but the task breaks the neos cache code

Exception in line 118 of /data/Packages/Libraries/neos/cache/Classes/Frontend/PhpFrontend.php: syntax error, unexpected '*'

The code

/**
 * @Scheduler\Schedule(expression="*/5 * * * *")
 */

breaks in the IDE, cause of the */in the expression, which closes the multiline comment

bweinzierl commented 5 years ago

We experienced this issue too. Makes the package unusable for many cases. A workaround could be to use another character like | and replace it later in the code of the annotation. Not a nice solution i admit.

I think best would be to change the implementation and forget about the annotation all together or does anybody see another solution?

markuspfeifenberger commented 5 years ago

We experienced this issue too. Makes the package unusable for many cases. A workaround could be to use another character like | and replace it later in the code of the annotation. Not a nice solution i admit.

I think best would be to change the implementation and forget about the annotation all together or does anybody see another solution?

It is possible to use the notation like this, as workaround ...

/**
 * @Scheduler\Schedule(expression="0,5,10,15,20,25,30,35,40,45,50,55 * * * *")
 */