(20250124) Handling absence of'rs0' in reminders for work (cron).

This commit is contained in:
2025-01-24 10:33:29 +05:30
parent 6b7407ced2
commit c9c2a799de
+4 -1
View File
@@ -307,7 +307,9 @@ async def get_reminders_to_send() -> pd.DataFrame | None:
# Create the response DataFrame: # Create the response DataFrame:
if db_status == 1 and not exception: if db_status == 1 and not exception:
reminders_df = pd.DataFrame(db_json["data"]["rs0"]) reminders_json = db_json["data"].get("rs0", [])
if reminders_json:
reminders_df = pd.DataFrame()
reminders_df.rename( reminders_df.rename(
columns = { columns = {
"token_id": "tokenKey", "token_id": "tokenKey",
@@ -318,6 +320,7 @@ async def get_reminders_to_send() -> pd.DataFrame | None:
}, },
inplace = True inplace = True
) )
else: no_context_printer("No reminder(s)")
# If something goes wrong: # If something goes wrong:
except Exception as e: except Exception as e: