Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

667 B
Raw Blame
from gevent.monkey import is_module_patched

# Celery patches the stdlib before importing this entrypoint for -P gevent. Prefork workers
# (including the KnowledgeFS local engine) must retain native subprocess, DB and gRPC behavior.
if is_module_patched("socket"):
    import psycogreen.gevent as pscycogreen_gevent
    from grpc.experimental import gevent as grpc_gevent

    grpc_gevent.init_gevent()
    print("gRPC patched with gevent.", flush=True)  # noqa: T201
    pscycogreen_gevent.patch_psycopg()
    print("psycopg2 patched with gevent.", flush=True)  # noqa: T201


# Import after gevent patching.
from app import app, celery

__all__ = ["app", "celery"]