IKANOW / Aleph2

The IKANOW v2 meta-database and analytics platform
Apache License 2.0
2 stars 1 forks source link

Natty parser doesn't use recurrance field #96

Open cburch opened 8 years ago

cburch commented 8 years ago

http://natty.joestelmach.com/try.jsp#

scheduling jobs to happen everyday you want to use terms like "every 2am", currently the scheduler ignores the every and just schedules for TODAY at 2am (which has typically passed already). There is a natty field called recurrence that can be used to calculate the next valid date possible.

Alex-Ikanow commented 8 years ago

Actually thinking about this some more, the recurrence flag doesn't give you much, since it doesn't include a recurrence period. So regardless, if date() < now (by more than some amount of time?!) then you're probably stuck having to parse the syntax tree to figure out how much to jump forward (eg every 2am vs every 10 minutes vs every wednesday)

Hmm in practice I think the "every 2am" daily case might be the only practical one? So perhaps can just do something pragmatic, like adjust the base date by 1 hour -> 1 day -> 1 week -> 1 month then give up and return

(interestingly "every friday 2am" works, as does "every night 2am")