mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-23 18:18:18 +00:00
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.
15 lines
525 B
Python
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()
|