Services
loglife.app.services.reminder.worker
Background worker for checking and sending scheduled reminders.
Runs a minutely job to check if any user reminders are due for their timezone.
build_journal_reminder_message(user_id)
Construct the journaling reminder message, listing untracked goals if any.
Source code in src/loglife/app/services/reminder/worker.py
70 71 72 73 74 75 76 77 78 79 80 | |
build_standard_reminder_message(goal)
Construct a standard reminder message for a specific goal.
Source code in src/loglife/app/services/reminder/worker.py
83 84 85 86 87 88 | |
check_reminders()
Check all reminders and send notifications when scheduled time matches.
Source code in src/loglife/app/services/reminder/worker.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
get_timezone_safe(timezone_str)
Get ZoneInfo, falling back to UTC if timezone is invalid or unknown.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timezone_str
|
str
|
Timezone string in IANA format (e.g., "Asia/Karachi", "America/New_York") |
required |
Returns:
| Type | Description |
|---|---|
ZoneInfo
|
A ZoneInfo object for the given timezone string, or UTC if the timezone |
ZoneInfo
|
is invalid or unknown. |
Source code in src/loglife/app/services/reminder/worker.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
is_reminder_due(goal, user, now_utc)
Check if a reminder is due at the current time for the user's timezone.
Source code in src/loglife/app/services/reminder/worker.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
process_due_reminder(user, goal)
Process a due reminder by fetching the goal and sending the notification.
Source code in src/loglife/app/services/reminder/worker.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
start_reminder_service()
Start the reminder service in a daemon thread.
Source code in src/loglife/app/services/reminder/worker.py
140 141 142 143 144 145 146 147 148 | |