Skip to content

Commit 3e17881

Browse files
authored
Refactor process_running_jobs background task (#3648)
* Extract running job helper functions * Split running job state handlers * Introduce running job context * Extract running job startup context * Use keyword args for running job RPCs * Defer running job payload loading * Fix missing jrd update * Extract backend provisioning helpers
1 parent 77750a3 commit 3e17881

6 files changed

Lines changed: 940 additions & 543 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Python targets 3.9+ with 4-space indentation and max line length of 99 (see `ruff.toml`; `E501` is ignored but keep lines readable).
1919
- Imports are sorted via Ruff’s isort settings (`dstack` treated as first-party).
2020
- Keep primary/public functions before local helper functions in a module section.
21+
- Roughly keep function definitions in the order they are referenced within a file so call flow stays easy to follow.
22+
- Prefer early returns over nested `if`/`else` blocks when they make the control flow simpler.
2123
- Keep private classes, exceptions, and similar implementation-specific types close to the private functions that use them unless they are shared more broadly in the module.
2224
- Prefer pydantic-style models in `core/models`.
2325
- Document attributes when the note adds behavior, compatibility, or semantic context that is not obvious from the name and type. Use attribute docstrings without leading newline.

0 commit comments

Comments
 (0)