Skip to content

Commit 586f312

Browse files
Copilotthawn
andcommitted
Save command-line port and host to database for PDF generation
When the server is started with --port or --host command-line arguments, these values are now persisted to the database. This ensures that PDF generation (which uses the port from the database config) uses the correct port that the server is actually listening on. Fixes issue where chromium PDF generation was using the default port 10020 from the database instead of the actual server port (e.g., 8080) when started with --port argument in Docker containers. Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
1 parent 3bf9a67 commit 586f312

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ttmp32gme/ttmp32gme.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,11 +812,15 @@ def main():
812812
apply_log_level(log_level_str)
813813
logger.info(f"Log level set to {log_level_str} from config")
814814

815-
# Override config with command-line args
815+
# Override config with command-line args and save to database
816816
if args.port:
817817
config["port"] = args.port
818+
db.set_config_value("port", str(args.port))
819+
logger.info(f"Port set to {args.port} from command line and saved to database")
818820
if args.host:
819821
config["host"] = args.host
822+
db.set_config_value("host", args.host)
823+
logger.info(f"Host set to {args.host} from command line and saved to database")
820824

821825
port = int(config.get("port", 10020))
822826
host = config.get("host", "127.0.0.1")

0 commit comments

Comments
 (0)