Commit 9bee65f
fix(fantawild): guard time parsing + short-cache empty schedules
Both Copilot comments on commit bfc9945:
- parseBusinessTime validates time strings via isValidHHMM() before
feeding them to constructDateTime. A malformed entry now drops just
that entry instead of throwing and aborting the whole sweep.
hhmmToMinutes also rejects out-of-range hours/minutes (>24h, >59m)
so '25:00' is treated as malformed rather than producing nonsense.
- scrapeSchedule @cache uses a dynamic TTL: 6h for a populated result,
60s for an empty one. Stops a transient CDN/parse failure from
freezing a fabricated zero-day schedule for hours. Mirrors the
'cache only TRUE, never FALSE' pattern already established for
derived boolean flags.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent bfc9945 commit 9bee65f
2 files changed
Lines changed: 54 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
184 | 219 | | |
185 | 220 | | |
186 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
| |||
195 | 202 | | |
196 | 203 | | |
197 | 204 | | |
198 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
199 | 208 | | |
200 | 209 | | |
201 | 210 | | |
| |||
204 | 213 | | |
205 | 214 | | |
206 | 215 | | |
207 | | - | |
| 216 | + | |
| 217 | + | |
208 | 218 | | |
209 | 219 | | |
210 | 220 | | |
| |||
353 | 363 | | |
354 | 364 | | |
355 | 365 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
361 | 371 | | |
362 | | - | |
| 372 | + | |
363 | 373 | | |
364 | 374 | | |
365 | 375 | | |
| |||
0 commit comments