Convert log to string for fallback server
This commit is contained in:
parent
ad3b579829
commit
7b7c5f932e
1 changed files with 3 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
from argparse import Namespace
|
||||
|
|
@ -150,7 +151,8 @@ def serve_from_cli(argv: Optional[list[str]] = None) -> None:
|
|||
print(f"Error: {e}") # noqa: T201
|
||||
print("Starting fallback server.") # noqa: T201
|
||||
try:
|
||||
log_history = OFM_HANDLER.log_history
|
||||
# The log is a list of dicts, fallback server expects a string
|
||||
log_history = json.dumps(OFM_HANDLER.log_history, indent=2)
|
||||
except BaseException:
|
||||
# If log history fails for any reason carry on.
|
||||
log_history = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue