Commit bee3f1b
Fix antipatterns: remove rescue blocks and sleep-based timing in tests
DB Queries:
- Removed safe_query_list/2 and safe_chart_query/2 catch-all blocks
- Let DB connection pool handle retries via timeouts (existing mechanism)
- Added rescue handlers in :refresh_stats, :refresh_queues, :refresh_charts
to log and reschedule on failure, preventing GenServer crash
- DB errors now logged but don't interrupt service
Tests:
- Removed :timer.sleep(50) from "sync_sonarr shows error when sync already in progress"
- Instead, call render/1 after sending message to process it synchronously
- No more timing-dependent flaky tests
This leverages the existing DB timeout and connection pooling retry logic
instead of catching errors at the GenServer level.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>1 parent 4f5cf35 commit bee3f1b
2 files changed
Lines changed: 30 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
290 | 295 | | |
291 | 296 | | |
292 | 297 | | |
| |||
299 | 304 | | |
300 | 305 | | |
301 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
302 | 316 | | |
303 | 317 | | |
304 | 318 | | |
| |||
315 | 329 | | |
316 | 330 | | |
317 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
318 | 337 | | |
319 | 338 | | |
320 | 339 | | |
| |||
330 | 349 | | |
331 | 350 | | |
332 | 351 | | |
333 | | - | |
| 352 | + | |
334 | 353 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
356 | 357 | | |
357 | 358 | | |
358 | 359 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | 360 | | |
370 | 361 | | |
371 | 362 | | |
| |||
382 | 373 | | |
383 | 374 | | |
384 | 375 | | |
385 | | - | |
386 | | - | |
387 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
388 | 379 | | |
389 | 380 | | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | 381 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
290 | 291 | | |
291 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
292 | 295 | | |
293 | 296 | | |
294 | 297 | | |
| |||
0 commit comments