Unified logging behaviour
- Logger doesn't start with log level DEBUG by default, instead reads a environment variable - Added extensive debug logging - Wrote a readme - Changed database healthcheck loop to only catch pymsql errors
This commit is contained in:
1 parent
37476c814e
commit
b272e069d4
6 files changed
+120
-35
No files matched your search
@@ -1,2 +1,38 @@
|
||||
# backend-push-notifications
|
||||
# Backend Push Notifications
|
||||
|
||||
|
||||
## Overview
|
||||
This part of the backend handles device push notifications for registered users. It consumes messages from RabbitMQ, looks up user device tokens from a MySQL database, and sends notifications via Expo's API. Failed deliveries are retried or sent to a dead-letter queue.
|
||||
|
||||
|
||||
## Requirements
|
||||
- Python 3.12+
|
||||
- MySQL database
|
||||
- RabbitMQ
|
||||
- Python packages from requirements.txt
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
**Environment variables:**
|
||||
|
||||
- `LOG_LEVEL` (DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
||||
|
||||
- `RABBITMQ_URL`
|
||||
|
||||
- `MYSQL_HOST`, `MYSQL_USER`, `MYSQL_PASSWORD`, `MYSQL_DATABASE`
|
||||
|
||||
- `API_ENDPOINT` (Expo push API)
|
||||
|
||||
|
||||
## Metrics
|
||||
|
||||
Metrics are exposed on port `9000` for Prometheus, including:
|
||||
|
||||
- `MSG_PUBLISHED`
|
||||
|
||||
- `MSG_FAILED`
|
||||
|
||||
- `MSG_RETRY`
|
||||
|
||||
- Queue sizes
|
||||
Reference in new issue
Block a user