Class: Plutonium::Wizard::Session

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/plutonium/wizard/session.rb

Overview

ActiveRecord model backing the plutonium_wizard_sessions table.

Identity is the derived InstanceKey digest stored in instance_key; the polymorphic owner/anchor/scope refs exist for listing and rebuilding context, not for identity. At-rest encryption (the wizard's encrypt_data opt-in) is applied by Plutonium::Wizard::Store::ActiveRecord as a self-describing envelope in the data column, not statically here — so this model stays a plain schema mapping.

Constant Summary collapse

COMPLETING_GRACE =

How long a row may sit in completing before the sweep treats it as a CRASHED finalize and reaps it. A healthy finalize flips to completing, runs execute, and completes/clears the row within seconds — but execute runs OUTSIDE the completion lock and does not bump expires_at, so a sweep firing mid-finalize must NOT cancel it (that would destroy the run's tracked records out from under the in-flight execute, §6.2). The grace window distinguishes a finalize that is still running (recent updated_at) from one that crashed (stale updated_at). Generous on purpose.

15.minutes