Get project's default concurrency (1-5). Args: name: The project name. Returns: The default concurrency value (defaults to 3 if not set or project not found).
(name: str)
| 410 | |
| 411 | |
| 412 | def get_project_concurrency(name: str) -> int: |
| 413 | """ |
| 414 | Get project's default concurrency (1-5). |
| 415 | |
| 416 | Args: |
| 417 | name: The project name. |
| 418 | |
| 419 | Returns: |
| 420 | The default concurrency value (defaults to 3 if not set or project not found). |
| 421 | """ |
| 422 | _, SessionLocal = _get_engine() |
| 423 | session = SessionLocal() |
| 424 | try: |
| 425 | project = session.query(Project).filter(Project.name == name).first() |
| 426 | if project is None: |
| 427 | return 3 |
| 428 | return getattr(project, 'default_concurrency', 3) or 3 |
| 429 | finally: |
| 430 | session.close() |
| 431 | |
| 432 | |
| 433 | def set_project_concurrency(name: str, concurrency: int) -> bool: |
no test coverage detected