mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-18 00:55:50 +00:00
Enhancement: Add release_connections parameter to PluginManager, allowing for conditional database connection closure during plugin discovery, improving resource management.
This commit is contained in:
parent
dff97d9067
commit
ae58fdb980
1 changed files with 3 additions and 1 deletions
|
|
@ -68,6 +68,7 @@ class PluginManager:
|
|||
sync_db: bool = True,
|
||||
force_reload: bool = False,
|
||||
use_cache: bool = False,
|
||||
release_connections: bool = True,
|
||||
) -> Dict[str, LoadedPlugin]:
|
||||
token = self._get_reload_token()
|
||||
if use_cache and not force_reload:
|
||||
|
|
@ -103,7 +104,8 @@ class PluginManager:
|
|||
)
|
||||
finally:
|
||||
# Discovery runs outside Django's request/task cycle (boot, worker_ready).
|
||||
close_old_connections()
|
||||
if release_connections:
|
||||
close_old_connections()
|
||||
|
||||
def _discover_plugins_impl(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue