(id)
| 471 | ) |
| 472 | |
| 473 | def get_project_port(id): |
| 474 | project_path = os.path.join(PROJECTS_DIR, id) |
| 475 | if os.path.exists(os.path.join(project_path, "port.txt")): |
| 476 | with open(os.path.join(project_path, "port.txt"), "r") as f: |
| 477 | return int(f.read().strip()) |
| 478 | return find_free_port(PROJECT_MIN_PORT, PROJECT_MAX_PORT) |
| 479 | |
| 480 | def is_port_in_use(port: int) -> bool: |
| 481 | import socket |
no test coverage detected