MishkaCmsMigration.Resources.Validations.SiteIdle (Mishka CMS Migration v0.0.1)

Copy Markdown View Source

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

Summary

Functions

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

Functions

running?(arg1)

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

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