# `MishkaCmsMigration.Resources.Validations.SiteIdle`
[🔗](https://github.com/mishka-group/mishka_cms_migration/blob/v0.0.1/lib/mishka_cms_migration/resources/__validations/site_idle.ex#L5)

Holds an admin's choice on an item (`MishkaCmsMigration.MigrationItem`'s `:leave_out`,
`:bring_back`, `:choose`, `:decide_keep` and `:decide_import`, and their master actions) while
one of the item's site's runs is dry running or
importing: the job reads the choices as it walks, so one made halfway would hold for part of the
run alone.

    update :leave_out do
      validate MishkaCmsMigration.Resources.Validations.SiteIdle, before_action?: true
    end

The site's runs are read as the admin, under the item's site. Run it with `before_action?: true`,
so the policies have let the admin make the choice before their runs are read.

An atomic action (`:decide`, one update for a whole group) runs it once for the update, under
its tenant, not once per item; a run the admin may not read counts as none, and the items'
own policies then refuse the change.

    update :decide do
      validate MishkaCmsMigration.Resources.Validations.SiteIdle
    end

# `running?`

```elixir
@spec running?(term()) :: boolean()
```

Whether `error` is this validation's refusal: a run of the item's site is running now.

---

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