fixed "verbose" argument (#6289)

Signed-off-by: bigcat88 <bigcat88@icloud.com>
This commit is contained in:
Alexander Piskun 2024-12-31 11:27:09 +03:00 committed by GitHub
parent b7572b2f87
commit 02eef72bf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -211,7 +211,9 @@ async def run(server_instance, address='', port=8188, verbose=True, call_on_star
addresses = []
for addr in address.split(","):
addresses.append((addr, port))
await asyncio.gather(server_instance.start_multi_address(addresses, call_on_start), server_instance.publish_loop())
await asyncio.gather(
server_instance.start_multi_address(addresses, call_on_start, verbose), server_instance.publish_loop()
)
def hijack_progress(server_instance):

View File

@ -807,7 +807,7 @@ class PromptServer():
async def start(self, address, port, verbose=True, call_on_start=None):
await self.start_multi_address([(address, port)], call_on_start=call_on_start)
async def start_multi_address(self, addresses, call_on_start=None):
async def start_multi_address(self, addresses, call_on_start=None, verbose=True):
runner = web.AppRunner(self.app, access_log=None)
await runner.setup()
ssl_ctx = None
@ -818,7 +818,8 @@ class PromptServer():
keyfile=args.tls_keyfile)
scheme = "https"
logging.info("Starting server\n")
if verbose:
logging.info("Starting server\n")
for addr in addresses:
address = addr[0]
port = addr[1]
@ -834,7 +835,8 @@ class PromptServer():
else:
address_print = address
logging.info("To see the GUI go to: {}://{}:{}".format(scheme, address_print, port))
if verbose:
logging.info("To see the GUI go to: {}://{}:{}".format(scheme, address_print, port))
if call_on_start is not None:
call_on_start(scheme, self.address, self.port)