feat: improve scheduler recurrence, DB config, and docs
- Broaden scheduler query window to next N days for proper recurring event expansion (scheduler.py) - Update DB connection logic for consistent .env loading and fallback (database.py) - Harden timezone handling and logging in scheduler and DB utils - Stop auto-deactivating recurring events before recurrence_end (API/events) - Update documentation to reflect new scheduler, API, and logging behavior
This commit is contained in:
@@ -16,11 +16,15 @@ groups_bp = Blueprint("groups", __name__, url_prefix="/api/groups")
|
||||
|
||||
|
||||
def get_grace_period():
|
||||
"""Wählt die Grace-Periode abhängig von ENV."""
|
||||
"""Wählt die Grace-Periode abhängig von ENV.
|
||||
|
||||
Clients send heartbeats every ~65s. Grace period allows 2 missed
|
||||
heartbeats plus safety margin before marking offline.
|
||||
"""
|
||||
env = os.environ.get("ENV", "production").lower()
|
||||
if env == "development" or env == "dev":
|
||||
return int(os.environ.get("HEARTBEAT_GRACE_PERIOD_DEV", "15"))
|
||||
return int(os.environ.get("HEARTBEAT_GRACE_PERIOD_PROD", "180"))
|
||||
return int(os.environ.get("HEARTBEAT_GRACE_PERIOD_DEV", "180"))
|
||||
return int(os.environ.get("HEARTBEAT_GRACE_PERIOD_PROD", "170"))
|
||||
|
||||
|
||||
def is_client_alive(last_alive, is_active):
|
||||
|
||||
Reference in New Issue
Block a user