Skip to content

Conversation

qedi-r
Copy link

@qedi-r qedi-r commented Mar 31, 2014

invalidates pull request #195

The agent has three mechanisms for repeating an event:

  • setting delay (eg, 10m, 2h)
  • setting a particular time (not particularly useful, since you could probably schedule the original event properly)
  • setting a particular time based on the incoming event, so if the event has a time it wishes to run at, set "run_at" to point to that JSON path

@qedi-r qedi-r mentioned this pull request Mar 31, 2014
@cantino
Copy link
Member

cantino commented Apr 1, 2014

Very nice again!

Could you add specs for this?

#either it's a time directly, or it's a json query
vp = Utils.value_at(event[:payload], options['run_at'])
vp ||= options['run_at']
trigger_time = Time.parse(vp, now)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't now undefined in this block?

@snicker
Copy link
Contributor

snicker commented Apr 1, 2014

This is awesome. I didnt notice until recently, but since I've been running the weather agent at 4am, it's giving me weather for the next day. I need to run it the night before to get the next day's weather, but I don't want my alerts to appear on my phone until 4am the next day. My only thought is that Time.parse won't be able to accept times for the next day.

Adding another dependency seems overkill, but https://github.com/mojombo/chronic has great natural-language processing for parsing time or timespans.

@cantino
Copy link
Member

cantino commented Oct 3, 2015

I've added #1055. If that meets your needs, awesome! If not, let me know and we can amend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants