mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-08 18:28:11 +08:00
#68 read process output until it exits
This commit is contained in:
@@ -17,6 +17,8 @@ from cellxgene_gateway.dir_util import make_annotations
|
|||||||
from cellxgene_gateway.env import cellxgene_args, enable_annotations, enable_backed_mode
|
from cellxgene_gateway.env import cellxgene_args, enable_annotations, enable_backed_mode
|
||||||
from cellxgene_gateway.process_exception import ProcessException
|
from cellxgene_gateway.process_exception import ProcessException
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SubprocessBackend:
|
class SubprocessBackend:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -55,7 +57,7 @@ class SubprocessBackend:
|
|||||||
scripts,
|
scripts,
|
||||||
cache_entry.key.annotation_file_path,
|
cache_entry.key.annotation_file_path,
|
||||||
)
|
)
|
||||||
logging.getLogger("cellxgene_gateway").info(f"launching {cmd}")
|
logger.info(f"launching {cmd}")
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
[cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True
|
[cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True
|
||||||
)
|
)
|
||||||
@@ -84,5 +86,6 @@ class SubprocessBackend:
|
|||||||
cache_entry.append_output(output)
|
cache_entry.append_output(output)
|
||||||
|
|
||||||
cache_entry.set_loaded(process.pid)
|
cache_entry.set_loaded(process.pid)
|
||||||
|
for output in process.communicate():
|
||||||
return
|
logger.debug(f"cellxgene:{output}")
|
||||||
|
logger.info(f"exiting {cmd}")
|
||||||
|
|||||||
Reference in New Issue
Block a user