fix: apply gevent threading patch early and ensure unique workflow node execution IDs (#12196)
Signed-off-by: -LAN- <laipz8200@outlook.com>pull/12252/head
parent
fc29f2003e
commit
d4b848272e
@ -1,19 +0,0 @@
|
|||||||
from configs import dify_config
|
|
||||||
|
|
||||||
|
|
||||||
def apply_gevent_threading_patch():
|
|
||||||
"""
|
|
||||||
Run threading patch by gevent
|
|
||||||
to make standard library threading compatible.
|
|
||||||
Patching should be done as early as possible in the lifecycle of the program.
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
if not dify_config.DEBUG:
|
|
||||||
from gevent import monkey # type: ignore
|
|
||||||
from grpc.experimental import gevent as grpc_gevent # type: ignore
|
|
||||||
|
|
||||||
# gevent
|
|
||||||
monkey.patch_all()
|
|
||||||
|
|
||||||
# grpc gevent
|
|
||||||
grpc_gevent.init_gevent()
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
def check_supported_python_version():
|
|
||||||
python_version = sys.version_info
|
|
||||||
if not ((3, 11) <= python_version < (3, 13)):
|
|
||||||
print(
|
|
||||||
"Aborted to launch the service "
|
|
||||||
f" with unsupported Python version {python_version.major}.{python_version.minor}."
|
|
||||||
" Please ensure Python 3.11 or 3.12."
|
|
||||||
)
|
|
||||||
raise SystemExit(1)
|
|
||||||
Loading…
Reference in New Issue