invoice_az's amas_api was rewritten so import_bulk_employees:
- takes a per-Asan-Login lock (Asan Login.amas_import_running)
BEFORE enqueueing, returning {already_running: True} if the lock
is held;
- inside the worker, runs Phase A (parallel ThreadPool, 10 detail
fetches concurrently) then Phase B (sequential DB writes with
prefetched payloads), so realtime amas_import_progress now
carries phase: "fetch" | "save".
Call signature is unchanged; only the return value differs and the
internal mechanism is faster. Wizard updates:
- _materialize_amas_employees now captures the response and dumps
it into the "Jey Wizard trace: amas enqueued" breadcrumb (success,
enqueued, total / already_running flag, full message). Spotting a
stale lock at finalize-time on a fresh site is now possible from
the Error Log alone.
- If the first call comes back with already_running: True (would be
a stuck lock from a prior failed run — improbable on a freshly-
dropped site but cheap to defend against), we force-clear the two
Asan Login flags via direct db.set_value and retry once. The
second outcome lands in the same trace.
- Comment on the function rewritten to describe the two-phase
parallel/sequential flow so the next reader doesn't grep
invoice_az to figure out where the work happens.
JS side: no changes — the wizard fires-and-forgets; in-app progress
UI lives in invoice_az/client/employee.js (already updated upstream).
|
||
|---|---|---|
| jey_wizard | ||
| .editorconfig | ||
| .eslintrc | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| CLAUDE.md | ||
| README.md | ||
| license.txt | ||
| pyproject.toml | ||
README.md
Jey Wizard
Jey Wizard
Installation
You can install this app using the bench CLI:
cd $PATH_TO_YOUR_BENCH
bench get-app $URL_OF_THIS_REPO --branch main
bench install-app jey_wizard
Contributing
This app uses pre-commit for code formatting and linting. Please install pre-commit and enable it for this repository:
cd apps/jey_wizard
pre-commit install
Pre-commit is configured to use the following tools for checking and formatting your code:
- ruff
- eslint
- prettier
- pyupgrade
License
unlicense