umts / bojangles

Ruby script for monitoring the PVTA realtime bus departures feed
MIT License
0 stars 0 forks source link

Day switch at 4am #9

Closed dfaulken closed 8 years ago

dfaulken commented 8 years ago

Every day at 4am, we should switch from caching the previous day's departures to the current day's departures.

dfaulken commented 8 years ago

Confirmed with Timecop that we get Sunday service types at 3am Monday:

sunday = Time.now - ((8 * 60 * 60) + (24 * 3600))
 => 2016-02-29 03:00:18 -0500 # 2/29/2016 is a Monday
Timecop.freeze(sunday){ find_service_ids_today }
 => ["UM1516-UMTS-Sunday-10"]