# `MishkaCmsCore.Runtime.Workers.SiteTeardownWorker`
[🔗](https://github.com/mishka-group/mishka_cms_core/blob/v0.0.1/lib/mishka_cms_core/runtime/workers/site_teardown_worker.ex#L5)

Frees everything a permanently-deleted site loaded into memory.

Runs on the dedicated `:maintenance` queue so a large site's teardown never
competes with live module/asset compilation for other sites. The site's DB
rows (and all child rows) are already gone via the `ON DELETE CASCADE` from the
`:permanent_destroy` action; this worker only reclaims the in-memory artifacts:
compiled modules, cached CSS/JS, routing metadata, and on-disk templates.

The job carries the site name and the list of module-backed records captured
*before* the cascade ran (see
`MishkaCmsCore.Runtime.Resources.Changes.ScheduleSiteTeardown`), because those
rows no longer exist by the time this runs.

See `MishkaCmsCore.Runtime.Workers.RuntimeCompilerWorker` for the per-record
lifecycle and `MishkaCmsCore.Runtime.States.SiteState` for the request gate.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
