Add fallback to original medication reminders when adaptive tables don't exist
This commit is contained in:
@@ -399,13 +399,26 @@ def poll_callback():
|
|||||||
# Create daily schedules at midnight
|
# Create daily schedules at midnight
|
||||||
now = datetime.utcnow()
|
now = datetime.utcnow()
|
||||||
if now.hour == 0 and now.minute < POLL_INTERVAL / 60:
|
if now.hour == 0 and now.minute < POLL_INTERVAL / 60:
|
||||||
create_daily_adaptive_schedules()
|
try:
|
||||||
|
create_daily_adaptive_schedules()
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(
|
||||||
|
f"Could not create adaptive schedules (tables may not exist): {e}"
|
||||||
|
)
|
||||||
|
|
||||||
# Check reminders with adaptive timing
|
# Check reminders - try adaptive first, fall back to original
|
||||||
check_adaptive_medication_reminders()
|
try:
|
||||||
|
check_adaptive_medication_reminders()
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(f"Adaptive medication check failed, using fallback: {e}")
|
||||||
|
# Fall back to original medication check
|
||||||
|
check_medication_reminders()
|
||||||
|
|
||||||
# Check for nags
|
# Check for nags
|
||||||
check_nagging()
|
try:
|
||||||
|
check_nagging()
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(f"Nagging check failed: {e}")
|
||||||
|
|
||||||
# Original checks
|
# Original checks
|
||||||
check_routine_reminders()
|
check_routine_reminders()
|
||||||
|
|||||||
Reference in New Issue
Block a user