Go to file
Ali 10c07dfc0b Track new import_bulk_employees response shape (parallel refactor)
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).
2026-05-01 13:56:14 +00:00
jey_wizard Track new import_bulk_employees response shape (parallel refactor) 2026-05-01 13:56:14 +00:00
.editorconfig feat: Initialize App 2026-04-22 10:00:16 +00:00
.eslintrc feat: Initialize App 2026-04-22 10:00:16 +00:00
.gitignore feat: Initialize App 2026-04-22 10:00:16 +00:00
.pre-commit-config.yaml feat: Initialize App 2026-04-22 10:00:16 +00:00
CLAUDE.md Add FIFO/Moving Average picker; add CLAUDE.md 2026-04-24 13:01:18 +00:00
README.md feat: Initialize App 2026-04-22 10:00:16 +00:00
license.txt feat: Initialize App 2026-04-22 10:00:16 +00:00
pyproject.toml feat: Initialize App 2026-04-22 10:00:16 +00:00

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