Dispatcharr/apps/proxy/apps.py
SergeantPanda 21901498de fix(connections): ensure proper cleanup of geventpool checkouts across various components
This update addresses issues related to geventpool database connection leaks by consistently invoking `close_old_connections()` in `finally` blocks within the backup scheduler, plugin repository refresh, and core notification synchronization processes. These changes ensure that idle connections are properly released, preventing resource exhaustion. HLS proxy server has been disabled (hasn't been used). Additionally, the proxy server cleanup logic has been enhanced to safely handle the absence of proxy instances. Tests have been updated to validate these improvements and ensure stability in high-load scenarios.
2026-07-19 14:32:51 +00:00

15 lines
525 B
Python

import sys
from django.apps import AppConfig
class ProxyConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'apps.proxy'
verbose_name = "Stream Proxies"
def ready(self):
"""Initialize proxy servers when Django starts"""
if 'manage.py' not in sys.argv:
from .live_proxy.server import ProxyServer as LiveProxyServer
# HLS proxy retained in-tree but unused; live uses a singleton.
self.live_proxy = LiveProxyServer.get_instance()