Skip to content

Commit

Permalink
Fixed logging for fast bluebox timelord and added Visual Studio (.vs)… (
Browse files Browse the repository at this point in the history
#18558)

* Fixed logging for fast bluebox timelord and added Visual Studio (.vs) to gitignore.

* Make black CI check happy

* Ran through another "black" reformat to pass CI
  • Loading branch information
thesemaphoreslim authored Sep 15, 2024
1 parent a617ed5 commit 1b4b8e8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ activate
# Editors
.vscode
.idea
.vs

# Packaging
chia-blockchain.tar.gz
Expand Down
30 changes: 19 additions & 11 deletions chia/timelord/timelord_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,25 @@ async def spawn_process(
continue

async with process_mgr.manage_proc(proc):
stdout, stderr = await proc.communicate()
if stdout:
log.info(f"VDF client {counter}: {stdout.decode().rstrip()}")
if stderr:
if first_10_seconds:
if time.time() - start_time > 10:
first_10_seconds = False
else:
log.error(f"VDF client {counter}: {stderr.decode().rstrip()}")

await asyncio.sleep(0.1)
while True:
if proc.stdout is None or proc.stderr is None:
break
if proc.stdout.at_eof() and proc.stderr.at_eof():
break
stdout = (await proc.stdout.readline()).decode().rstrip()
if stdout:
log.info(f"VDF client {counter}: {stdout}")
stderr = (await proc.stderr.readline()).decode().rstrip()
if stderr:
if first_10_seconds:
if time.time() - start_time > 10:
first_10_seconds = False
else:
log.error(f"VDF client {counter}: {stderr}")

await asyncio.sleep(0.1)

await proc.communicate()


async def spawn_all_processes(config: Dict, net_config: Dict, process_mgr: VDFClientProcessMgr):
Expand Down

0 comments on commit 1b4b8e8

Please sign in to comment.