module

Prostore::Migration::Lease

Lease-based mutex for migrations (ADR-0009 invariant 5).

Constants

DEFAULT_DURATION = 5.minutes

Instance methods

claim(adapter, executor : Adapter::Base::Executor, migration_id : Int64, runner_id : String, duration : Time::Span = DEFAULT_DURATION) : Bool

Returns true if the lease was successfully claimed; false if another live lease is held.

Source
heartbeat(adapter, executor : Adapter::Base::Executor, migration_id : Int64, runner_id : String, duration : Time::Span = DEFAULT_DURATION) : Bool
Source
release(adapter, executor : Adapter::Base::Executor, migration_id : Int64, runner_id : String) : Nil
Source
runner_id
Source