mix queue_keeper.dead_code (queue_keeper_check v0.3.0)

Copy Markdown View Source
mix queue_keeper.dead_code [--json] [--ignore Worker] [--known Worker]

Compiles the project, loads config (including config/runtime.exs via app.config), and lists Oban.Worker modules that have no compile-time call sites and are not in the Oban or Oban Pro crontab from application env.

Needs the host app compiled; it does not start the application or Oban. Discover uses Application.spec/2 and Code.ensure_loaded/1.

A worker enqueued only through dynamic dispatch (a module name built at runtime with Module.concat, apply/3 on a string, and similar) will show up here even if production still runs it. Treat the list as review candidates, not proof of dead code. Runtime-only Pro cron rules stored in the database are not visible. Missing BEAM debug info or empty compile paths make the result incomplete; the report and JSON coverage object say so.

Exit 0 if there are no review candidates, 1 if at least one worker is reported, 3 on usage errors. JSON includes both review_candidates and a deprecated dead alias (the same list) for compatibility.