fix: shared data intitialization failed for multi-worker
This commit is contained in:
@@ -94,7 +94,6 @@ def create_app(args):
|
|||||||
logger.setLevel(getattr(logging, args.log_level))
|
logger.setLevel(getattr(logging, args.log_level))
|
||||||
set_verbose_debug(args.verbose)
|
set_verbose_debug(args.verbose)
|
||||||
|
|
||||||
# Display splash screen
|
|
||||||
from lightrag.kg.shared_storage import is_multiprocess
|
from lightrag.kg.shared_storage import is_multiprocess
|
||||||
logger.info(f"==== Multi-processor mode: {is_multiprocess} ====")
|
logger.info(f"==== Multi-processor mode: {is_multiprocess} ====")
|
||||||
|
|
||||||
@@ -421,9 +420,9 @@ def get_application():
|
|||||||
import types
|
import types
|
||||||
args = types.SimpleNamespace(**json.loads(args_json))
|
args = types.SimpleNamespace(**json.loads(args_json))
|
||||||
|
|
||||||
# if args.workers > 1:
|
if args.workers > 1:
|
||||||
# from lightrag.kg.shared_storage import initialize_manager
|
from lightrag.kg.shared_storage import initialize_share_data
|
||||||
# initialize_manager()
|
initialize_share_data()
|
||||||
|
|
||||||
return create_app(args)
|
return create_app(args)
|
||||||
|
|
||||||
@@ -486,6 +485,7 @@ def main():
|
|||||||
|
|
||||||
display_splash_screen(args)
|
display_splash_screen(args)
|
||||||
|
|
||||||
|
|
||||||
uvicorn_config = {
|
uvicorn_config = {
|
||||||
"app": "lightrag.api.lightrag_server:get_application",
|
"app": "lightrag.api.lightrag_server:get_application",
|
||||||
"factory": True,
|
"factory": True,
|
||||||
|
Reference in New Issue
Block a user