File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
klaudbiusz/cli/generation Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def main(
2727 mcp_binary : str | None = None ,
2828 mcp_args : list [str ] | None = None ,
2929 output_dir : str | None = None ,
30- max_concurrency : int = 8 ,
30+ max_concurrency : int = 6 ,
3131) -> None :
3232 """Bulk app generation via Dagger with parallelism.
3333
Original file line number Diff line number Diff line change @@ -137,15 +137,21 @@ async def _run_generation(
137137 # run generation
138138 result = container .with_exec (cmd )
139139
140- # capture combined stdout/stderr as log
141- log_content = await result .stdout ()
142- stderr_content = await result .stderr ()
143- full_log = f"{ log_content } \n \n === STDERR ===\n { stderr_content } " if stderr_content else log_content
144-
145- # save log to host
140+ # prepare log file path
146141 log_file_local = self .output_dir / "logs" / f"{ app_name } .log"
147142 log_file_local .parent .mkdir (parents = True , exist_ok = True )
148- log_file_local .write_text (full_log )
143+
144+ # capture stdout/stderr - even on failure we want to save what we can
145+ try :
146+ log_content = await result .stdout ()
147+ stderr_content = await result .stderr ()
148+ full_log = f"{ log_content } \n \n === STDERR ===\n { stderr_content } " if stderr_content else log_content
149+ log_file_local .write_text (full_log )
150+ except dagger .ExecError as e :
151+ # container command failed - save error output as log
152+ full_log = f"=== EXEC ERROR ===\n { e } \n \n === STDOUT ===\n { e .stdout } \n \n === STDERR ===\n { e .stderr } "
153+ log_file_local .write_text (full_log )
154+ raise
149155
150156 # export app directory (if it exists)
151157 app_dir_local = self .output_dir / app_name
You can’t perform that action at this time.
0 commit comments