kyletress / sledsheet

The app for fans, coaches, and athletes of the sliding sports.
www.sledsheet.com
0 stars 0 forks source link

Track and Timesheet Weather via Forecast.io #104

Closed kyletress closed 8 years ago

kyletress commented 8 years ago

Timesheets should show historical weather data. Tracks should show weekly (cached) weather data. Maybe use redis to cache the response of the track weather api call to forecast. Expire the cache after 24 hours (should be good enough).

I'm going to make very few API calls to Forecast, and I get 1000 per day. So if I schedule a call to forecast for track weather every 4 hours, that results in approximately 120 calls per day. Maybe the evening before a scheduled race, drop that down to a call every hour or something. Want to give people accurate weather.

I should probably schedule a task to run once per day to get the 5-day forecast for a track, using the local time.

kyletress commented 8 years ago

I am caching the API response using the Rails.cache.fetch method. Need to learn more about this. Also, I need to schedule weather to expire in 24 hours based on the local time of the track. It does me no good to show Sunday's weather when it's Monday.