mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-19 19:59:10 +08:00
fix: Lookup errors for contextvars used in ToolManager
This commit is contained in:
parent
ad899844a1
commit
77a62f33b3
@ -100,6 +100,13 @@ class ToolManager:
|
||||
"""
|
||||
get the plugin provider
|
||||
"""
|
||||
# check if context is set
|
||||
try:
|
||||
contexts.plugin_tool_providers.get()
|
||||
except LookupError:
|
||||
contexts.plugin_tool_providers.set({})
|
||||
contexts.plugin_tool_providers_lock.set(Lock())
|
||||
|
||||
with contexts.plugin_tool_providers_lock.get():
|
||||
plugin_tool_providers = contexts.plugin_tool_providers.get()
|
||||
if provider in plugin_tool_providers:
|
||||
|
Loading…
x
Reference in New Issue
Block a user