latest changes before manual submissions redesign
This commit is contained in:
@@ -121,3 +121,32 @@ server mode requires an audio file or browser mode.
|
||||
Browser assets are loaded only after the user enables the toggle and selects a
|
||||
file. Regenerate the self-hosted model using [the YAMNet build guide](scripts/BROWSER_YAMNET.md),
|
||||
then run `npm run build` and `python manage.py collectstatic --noinput`.
|
||||
# Pending event notifications
|
||||
|
||||
Users can test and enable an ntfy topic in Settings. New Pending events are
|
||||
counted by source (manual or sensor) in one-minute batches per enabled user.
|
||||
Run `python manage.py send_pending_notifications` once per minute with the
|
||||
application's Python environment and working directory. For example, a cron
|
||||
entry can use `* * * * * cd /path/to/django && /path/to/python manage.py send_pending_notifications`.
|
||||
It sends completed minute batches,
|
||||
then removes them; failed deliveries remain queued for the next run.
|
||||
|
||||
For a systemd user timer on the laptop, install the units in
|
||||
[`deploy/systemd/`](deploy/systemd/) and start the timer:
|
||||
|
||||
```sh
|
||||
cd /home/jorenmartijn/python/django
|
||||
/usr/bin/python3 -m venv /home/jorenmartijn/python/.venv-notifications
|
||||
/home/jorenmartijn/python/.venv-notifications/bin/python -m pip install -r requirements.txt
|
||||
/home/jorenmartijn/python/.venv-notifications/bin/python manage.py check
|
||||
mkdir -p ~/.config/systemd/user
|
||||
cp deploy/systemd/send-pending-notifications.service deploy/systemd/send-pending-notifications.timer ~/.config/systemd/user/
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now send-pending-notifications.timer
|
||||
systemctl --user list-timers send-pending-notifications.timer
|
||||
```
|
||||
|
||||
The service runs `/home/jorenmartijn/python/.venv-notifications/bin/python` with this
|
||||
project as its working directory. To keep the user timer running after logout,
|
||||
run `sudo loginctl enable-linger jorenmartijn` once on the laptop. Check a run
|
||||
with `journalctl --user -u send-pending-notifications.service -n 30`.
|
||||
|
||||
Reference in New Issue
Block a user